WordPress.org

Ready to get started?Download WordPress

Forums

Exclude Pages from Navigation Bar? (3 posts)

  1. chaseman
    Member
    Posted 3 years ago #

    I have blurbs (e.g. about blog, or about author) on the start page of my thenme and the user can write and edit the blurbs by simply creating a page.

    Now I want those blurbs to not show up in the navigation bar, not even for the admin.

    For the past hour I'm going through all the files trying to find a function that may help me achieve this. I have a WooThemes theme where you can tick off the pages you don't want in the navigation bar.

    They're using the standard wp_nav_menu() function to display the navi bar, and then they have their own show_page_menu() function, which they use to exclude pages as far as I can tell.

    But I simply can not figure out what the actual cause is to exclude the pages, I can not figure out the system behind it so I can write my own function.

    Does the query get modified, for example "get all pages except x pages", or what really happens here?

    I'd appreciate some pointers where to start so I can achieve this myself.

  2. chaseman
    Member
    Posted 3 years ago #

    Ok I found out that I can do it with:

    http://codex.wordpress.org/Function_Reference/wp_list_pages

    Now I'll have to figure out how to exactly implement it into the code, meaning where to place it.

  3. chaseman
    Member
    Posted 3 years ago #

    Ok found it out, you simply use it the same way how you'd use the normal navigation function, here's an example:

    wp_list_pages("exclude=64", array("link_before" => "<li><img src='$dir/images/arrow.png' /></li>", "theme_location" => "primary-menu"));

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.