Forums

[resolved] Children pages menu (3 posts)

  1. sergiselvas
    Member
    Posted 3 years ago #

    Hi Everyone
    I am trying to use a submenu each time there are children pages. I'm using this:

    <?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1'); if ($children) { ?>
    <?php echo $children; ?><? } ?>

    Chilndre pages menu is showing well, but when I click a children page on that submenu, it desapear from the submenu.

    Sorry for my english, I'm trying my best, what I need is show the submenu always unless I click on another page

    Thanks everyone for your help!

  2. sergiselvas
    Member
    Posted 3 years ago #

    Resolve, more or less. I use this:

    <?php
    if($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
    else
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    <?php echo $children; ?>
    <?php } ?>

    But now, if I'm reading a subpage the parent is not showing actived. There is any solution for this?

    Cheers

  3. sergiselvas
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic