Dec 6 2007

How to exclude pages from the list in Wordpress

If you're new here, you may want to start with my most popular posts. Then, subscribe to my RSS feed to stay updated. Thanks for visiting!

Google Query: exclude pages in wordpress list

If you are trying to use something like Google Custom Search on your Wordpress blog, you need to have a search results page set up in Wordpress to use the iframe Search configuration. This is fine, but you probably don’t want people to be able to navigate to that page via your navigation menu. The steps below will allow you to exclude the page from the Navigation list.

-First note the ID of the page that you want to exclude in the “Manage -> Pages” section of the Wordpress admin console.

-Find the file where you have used wp_list_pages() (In my case it was in the sidebar_navigation.php file).

-Add the &exclude=page id option to the wp_list_pages() entry.
For example, my entry looks like the one below for a page with the ID of 4.
wp_list_pages('sort_column=post_date&title_li=&exclude=4');

That’s it! Your page should be excluded from the navigation list now. If this helped you configure one of your own sites I would love to hear about it in the comments!

Happy Blogging!

Technorati Tags: ,

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

TAGS:

LEAVE A COMMENT

Subscribe Form

Subscribe to Blog

Sponsors

Recent Readers

JOIN MY COMMUNITY!
                  Computers Blogs - Blog Top Sites