-
<?php
if(count($post->ancestors)==2) $children = wp_list_pages("title_li=&depth=1&child_of=".$post->ancestors[1]."&echo=0&sort_column=menu_order");
elseif($post->post_parent) $children = wp_list_pages("title_li=&depth=1&child_of=".$post->post_parent."&echo=0&sort_column=menu_order");
else $children = wp_list_pages("title_li=&depth=1&child_of=".$post->ID."&echo=0&sort_column=menu_order");
if ($children) { echo $children;}
?>
How to hide child pages in sub navigation menu?
Started by
wal
, Jan 18 2010 01:10 PM
6 replies to this topic
#1
Posted 18 January 2010 - 01:10 PM
I would like to find out how I can 'hide' child page from the sub navigation menu.
_subnav.php
<div id="subnav" class="fix">
<!-- Code for subnav if pages have parents.. -->
#2
Posted 18 January 2010 - 08:12 PM
just add the 'exclude pages' plugin, it allows you to exclude pages really easily.
Does that help?
#3
Posted 20 January 2010 - 02:44 AM
It works!
Thanks lots!!!
#4
Posted 27 January 2010 - 10:21 PM
AP,
I used "Exclude Pages" in WHPro to solve this problem. After "deep integration" with bbPress, this stopped working. I saw your post on the bbPress support forum, and I have subscribed to it. It looks like you had the same problem. I was just curious if have found a solution or workaround that wasn't posted there?
Thanks,
Michael
#5
Posted 02 February 2010 - 04:49 AM
@hedgard still waiting on an answer?
#6
Posted 08 February 2010 - 08:07 PM
@jnoh - I ended up solving it another way. Instead of having a hidden page as a main/parent page with several child pages, I assigned the children to another parent and hid the individual children. Makes navigating the pages in admin a little clunky but works for now. Thanks for following up.
#7
Posted 10 February 2010 - 11:02 AM
oooo nice work around. I haven't thought of that one.









