WordPress.org

Ready to get started?Download WordPress

Forums

Page hierarchy in titles (4 posts)

  1. mganeff
    Member
    Posted 2 years ago #

    Hi, I'm looking for a plugin that can include the title of the parent pages in the title of a subpage and is clickable or a navigation bar on top of the page.

    Situtation now:
    Parent page:
    Title: Parent page
    Sub-page 1:
    Title: Sub-page 1
    Sub-page 2:
    Title: Sub-page 2

    What I would like to have:
    Parent page:
    Title: Parent page
    Sub-page 1:
    Title: Parent page > Sub-page 1
    Sub-page 2:
    Title: Parent page > Sub-page 1 > Sub-page 2

    I hope someone can help me :)

    My site:
    Ganeff.com

  2. Phil
    Member
    Posted 2 years ago #

    Try:

    <title><?php
    if($post->post_parent) {
    $parent_title = get_the_title($post->post_parent);
    echo $parent_title.' — ';
    } ?>
    <?php wp_title(''); ?>
    </title>
  3. mganeff
    Member
    Posted 2 years ago #

    Thanks!

    I got a couple of questions:

    In which file do i need to change the code?
    Will de titles be clickable?
    Is there maybe a plugin that takes care of is (can't find one..)

    Cheers!

  4. mganeff
    Member
    Posted 2 years ago #

    Got it working using Breadcrumb NavXT

Topic Closed

This topic has been closed to new replies.

About this Topic