Sidebar Link Listing Issues (Parent and Child pages)
-
I have searched the forums and documentation and cannot find a solution to exactly my issue. Hopefully someone knows the answer. I am trying to do the following.
In my sidebar.php file I want to list provide a list of links to children of the parent page that is being viewed BUT ONLY if the parent has children. This I can do with the following syntax:
<?php if(wp_list_pages("child_of=".$post->ID."&echo=0")) { ?>
<!-- List of Pages in this Section -->
<h3>Pages Within This Section:</h3>
<ul>
<?php wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order");?>
</ul>
<?php } ?>However when I go to one of the child pages the menu is no longer displayed and I would like it to be. I know the syntax above is filtering out the display because the child page does not have a child, but how can I modify it so that it knows to display the menu if there is a child?
- The topic ‘Sidebar Link Listing Issues (Parent and Child pages)’ is closed to new replies.