Support » How-To and Troubleshooting » [Resolved] Excluding pages from nav menu

[Resolved] Excluding pages from nav menu

  • I need to remove a link to a page on my nav menu, but I don’t want it to disappear from the Page menu in the sidebar.

    I’ve tried the ‘Exclude Pages’ plug-in by Simon Wheatley but this removes the page from both menus, is there a way to remove it from only the nav menu at the top whilst leaving the link in the Pages menu?

Viewing 7 replies - 1 through 7 (of 7 total)
  • you will need to edit the theme’s header.php and use the “exclude” code in the navbar section – look for this

    <?php wp_list_pages('title_li=&depth=1'); ?>
    change to this
    <?php wp_list_pages('title_li=&depth=1&exclude=45'); ?>

    where “45” is your page id to exclude

    Cheers for that I’ll give it a try this evening.

    Just had a quick look, I have this:

    <?php wp_list_pages('title_li=&parent=0&'); ?>

    should I change this to

    <?php wp_list_pages('title_li=&parent=0&exclude=xx'); ?>

    xx being the page id.

    yes – that will work

    Thanks and it does indeed work.

    I made another page my static home page – and it shows up on all navigation bars twice – as the home page and the static page. Any help on excluding or hiding one or the other? There is no page id assigned to it as it’s the home page.

    Thanks for any help.

    La M


    I need to do the same thing, but I don’t have this <?php wp_list_pages?> line in my header.php.

    I have a couple of legal pages that I don’t want listed in my top horizontal menu.

    I think the relevant code is:

      <?php if (get_option(‘ap_includeHome’) == 0){ ?>
      <li class=”<?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>”>/”><?php _e(‘Home’) ; ?>
      <?php } ?>
      <?php ap_buildMenu(); ?>
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Excluding pages from nav menu’ is closed to new replies.
Skip to toolbar