• Hey wp world,

    I’m using a piece of code to get my page title (displayed at the top of the browser.

    It displays the following order

    Parent Page Name – Page Name – Website Name

    However, I’d like it to display the following

    Page Name – Parent Page Name – Website Name

    The current code is as follows:

    <title><?php
    if($post->post_parent)
    {
    $parent_title = get_the_title($post->post_parent);
    echo $parent_title.' — ';
    } ?>
    <?php wp_title(''); ?>
    </title>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello!

    I am not sure if this is the solution you are searching for, but the Yoast SEO plugin has an option where you can set site-wide the page title, similarly to what you would like to achieve.

    Greetings,
    Balint

    Thread Starter rmetfd

    (@rmetfd)

    Thanks for the reply.

    I have the SEO Yoast plugin installed, however I’m looking for a dynamic solution

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘page meta title’ is closed to new replies.