• Hello everyone,

    I have a WP page where I’m pulling a specific post in and displaying it. In the <title> I would like to display post title followed by the page title.

    I have the following code:

    if (is_single()) {single_post_title(); echo " - "; wp_title(); echo " - "; bloginfo('name');}

    The single_post_title() – displays the title of my post (that’s great), but I was hoping wp_title() would display the page title, but instead it displays post title again.

    Is there a way to display both – post title and page title with such set up??

    Would really appreciate any help.
    Thanks,
    Dasha

The topic ‘Display both post title and page title’ is closed to new replies.