Forums

[resolved] Excluding pages from nav menu (7 posts)

  1. bearing
    Member
    Posted 3 months ago #

    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?

  2. samboll
    moderator
    Posted 3 months ago #

    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

  3. bearing
    Member
    Posted 3 months ago #

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

  4. bearing
    Member
    Posted 3 months ago #

    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.

  5. samboll
    moderator
    Posted 3 months ago #

    yes - that will work

  6. bearing
    Member
    Posted 3 months ago #

    Thanks and it does indeed work.

  7. newtrouble
    Member
    Posted 3 months ago #

    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.

Reply

You must log in to post.

About this Topic