Echo a Listing's title without shortcode?

WordPress Business Themes Forums Responsive Themes Comparison Theme Echo a Listing's title without shortcode?

Echo a Listing's title without shortcode?

February 3, 2017
Chuck Chuck
  • Chuck
    Chuck
    Newbie 70 points

    Does anyone know how to echo the title of a listing in php without using the [TITLE] shortcode or the do_shortcode function?

    February 3, 2017 at 6:50 pm
  • Chuck
    Chuck
    Newbie 70 points

    Nevermind.

    $title = get_the_title($postid = get_the_ID(), ‘title’, true);
    echo $title;

    Alternatively you could use…

    $postid = get_the_ID();
    $title = get_the_title($postid, ‘title’, true);
    echo $title;

    February 3, 2017 at 7:12 pm
  • Josh
    Josh
    Super Guru 13,887 points

    Thanks for sharing Chuck :)

    February 6, 2017 at 1:57 pm
Viewing 3 posts - 1 through 3 (of 3 total)

Didn't find what you were after?

Chat with us now

or contact our support team