WordPress.org

Ready to get started?Download WordPress

Forums

How to achieve the perfect side navigation for Child_Of ? (many tries) (3 posts)

  1. MPESGT01
    Member
    Posted 8 months ago #

    I have read and tryed this :
    http://codex.wordpress.org/Function_Reference/wp_list_pages

    What I want but can get it the right way is having a sidebar sub-navigation showing the child pages, preferably inside a page/section So like a second navigation in sidebar just for this section.

    mysite.com
    works! (nothing is showing)

    mysite.com / page A
    works! (but would be better without the subsub showing)

    mysite.com / page A / sub-page A
    works! (perfect!! just like a cute second nav of this section, yay! )

    mysite.com / page A / sub-page A / subsub A
    Doesn't work! (nothing is showing... so how to go back ? Maybe because there is no more children page regarding the WP nav... I would like it to show exactly like on "sub-page A" please.)

    Oh, and here is the code I am using

    <?php
      $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
      if ($children) { ?>
      <aside class="widget childof">
      <h3>Related pages</h3>
      <ul>
      <?php echo $children; ?>
      </ul>
      </aside>
      <?php } ?>
  2. MPESGT01
    Member
    Posted 8 months ago #

    cam it be some solution like this ?

    if : child child = show childs
    and
    if : child child child = show parent

  3. MPESGT01
    Member
    Posted 8 months ago #

    By the time someone may answer if that if possible or not, I was thinking using Yoast Breadcrumbs with a twist...

Reply

You must log in to post.

About this Topic