Jump to content
Sign in to follow this  
wal

How to hide child pages in sub navigation menu?

Recommended Posts

wal    0
wal

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.. -->

  • <?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;} ?>
</div><!-- /sub nav -->

Share this post


Link to post
Share on other sites
Andrew    201
Andrew

just add the 'exclude pages' plugin, it allows you to exclude pages really easily. Does that help?

Share this post


Link to post
Share on other sites
hedegard    0
hedegard

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

Share this post


Link to post
Share on other sites
hedegard    0
hedegard

@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.

Share this post


Link to post
Share on other sites
jnoh    0
jnoh

oooo nice work around. I haven't thought of that one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×