Jump to content


Photo
- - - - -

How to hide child pages in sub navigation menu?


This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1 wal

wal

    Newbie

  • Members
  • Pip
  • 2 posts

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

#2 arpowers

arpowers

    Founder

  • Administrators
  • 3254 posts

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 wal

wal

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 January 2010 - 02:44 AM

It works! Thanks lots!!!

#4 hedegard

hedegard

    Newbie

  • Members
  • Pip
  • 7 posts

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 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 02 February 2010 - 04:49 AM

@hedgard still waiting on an answer?

#6 hedegard

hedegard

    Newbie

  • Members
  • Pip
  • 7 posts

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 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 10 February 2010 - 11:02 AM

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