Forums

wp_list_pages sub sub-pages (3 posts)

  1. Tommie Hansen
    Member
    Posted 3 years ago #

    I've got a problem with listning the parent and its sub-pages when on a sub-sub-page.

    My current code is 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) { ?>
    			<div id="subnav">
    				<div class="subtop"></div>
    					<div class="subcontent">
    						<ul>
    						<?php echo $children; ?>
    						</ul>
    					</div>
    				<div class="subbottom"></div>
    			</div>
    			<?php } ?>

    What i want to do is have the menu show the same all the time even when on a SUB-SUB-page. Now it's just the same when on the top-parent and when on a child. Not when on a child of a child ...

    How can i modify that code the display the parent and its childs even when on a child of a child?

    Please help. :)

    Regards,
    Tommie Hansen

  2. basketball
    Member
    Posted 2 years ago #

    Looking for a solution for this as well

  3. kapiljain.in
    Member
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.