Support » Fixing WordPress » Displaying Parent Page on Child Page

  • Hey everyone!

    I’m just new to the forums, and I have a quick (and hopefully easy) question.

    I have a site that has several parent pages, with several child pages under each. When I click on a child page, I would like the name of the parent page and the child page to each be displayed at the top of the page (instead of just the current page name, as it does now).

    I’m sure there must be some piece of PHP code that I can insert to do this, but I’m still very early in the learning process when it comes to PHP. Can anyone offer a suggestion?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I need this too!

    I have as my page order:

    Home Page
    – Food
    – Sports
    – – Football
    – – Soccer
    – Cars
    – About Us

    When I visit the “Food Page” i see a all Food, Sports (w/children), Cars, and About. When I visit Football, I only see Football.

    You can take a look at this page:

    The code below will list all the child pages.

    So if you’re using impresslab’s site, and you’re on Sports -> Football , this code will list Football, Soccer

      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <?php echo $children; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Displaying Parent Page on Child Page’ is closed to new replies.