How to remove Page Links from header menu?

  • Unknown's avatar

    I am using WordPress to build a site. I use a custom made template that has 4 footer links – Contact Us, Terms of Use, Disclaimer and Privacy Policy.

    I have created Pages for all of the aforesaid footer links. But everytime I publish the page, the link also gets displayed in the header menu.

    I want the footer links to remain as it is and could anyone help me by telling how to prevent links from appearing in the header menu. For your info, I already have the following links in the header menu – Home, About, Contact Us. I want to retain these and prevent new links from appearing.

    Any help shall be greatly appreciated.

  • Unknown's avatar

    Please paste the exact URL of your blog when asking questions here, or link your nickname to your blog (as explained in the Sticky 8 Things to Know Before Posting). We cannot help without that.

  • Unknown's avatar

    Hi

    I am afraid I am not in a position to reveal the name of my site now. However I believe that my query was very clear. Any help shall be appreciated.

    Cheers
    Raj

  • Unknown's avatar

    Sorry, we must at least know if you’ve got a wp.COM or a wp.ORG blog, plus which theme you’re using.

  • Unknown's avatar

    Hi

    I have found a fix to the problem. Here is what I did, if it could be of help to someone. I am not a very technical person, so bear with my lingo.

    1. the function to define the display of Page Links in the header menu is:
    wp_list_pages()
    This is typically located in wp-includes/post-template.php. In my case it was located in functions.php.

    2. Also find out the id corresponding to the pages for which you want links to appear on the header menu. To find the id, go to Pages->Edit and hover over the page link, you can see a number getting displayed on the bottom left of your browser. Say these numbers are 2, 11, 15

    3. Add this to your wp_list_pages() function.

    wp_list_pages(‘include=2,11,15&title_li=’);

    4. This will only display the links of those pages corresponding to the ids used above. The rest wont be displayed.

    Hope this helps…Happy blogging!

    Raj

  • Unknown's avatar

    Turns out you’re in the wrong forum after all. See the Stickies up top in this forum.

    (One of the reasons we need the link to the blog is so that both you and us won’t waste our time.)

  • Unknown's avatar

    You’re right mate! I figured it out late, though!! Thanks for your notes… Cheers

  • The topic ‘How to remove Page Links from header menu?’ is closed to new replies.