WordPress « Kevin Pajak – Interactive Web Developer/Designer – BLOG

Posts Tagged ‘WordPress’

How to exclude pages/categories from navigation listings on WordPress

Tuesday, November 10th, 2009

OK, I am writing this post to share a little bit of info that I discovered last night, while doing some WordPress editing work for a client of mine. He had several categories and pages that needed to be included on his site, but he wanted five pages to be linked in the footer that obviously we didn’t want to re-list in the main nav listing that appeared in the theme’s Header. After doing a bit of searching online, I did discover this post in the WP dev forums:

http://codex.wordpress.org/Template_Tags/wp_list_pages#Exclude_Pages_from_List

This covers the basics of how to exclude pages from your navbar listings, but there’s only one problem (and at first I was freaking out over this): they indicate to exclude by page ID, but the newer versions of WordPress don’t use a page ID, SO, here is what you do:

1) Go to ‘Pages > Edit’
2) Mouseover the page you will be wanting to exclude from your list, and see the URL that appears (for example: http://www.kevinpajak.com/blog/wp-admin/page.php?action=edit&post=2). You notice that you will actually see the number listed as a post!
3) Grab this number for each page you need to exclude, and plop it into this code in your header/sidebar/navbar page code:

For example:
<?php wp_list_pages(‘exclude=16,18,20,22′); ?>

Voila! You should be all set (Oh, and if your wp_list_pages function happens to have additional code, you will need to make sure you include the ampersand character with it (&).

Ex:
<?php wp_list_pages(‘title_li=&exclude=96,98,100,102,104′); ?>

Last of all, there is also a plugin you might want to try, called ‘Exclude Pages’ that should take care of this for you automatically if you prefer. I haven’t tried it yet, but definitely worth a look ;) .

Have fun WordPressers, good luck, and please feel free to share your feedback anytime! :-) .

————————————————————-

PS: To exclude categories from your navigation listings, follow the same procedure:

1) Take a look at your overall category list (‘Edit > Categories’),
2) This time find the CAT ID (Ex: http://www.kevinpajak.com/blog/wp-admin/categories.php?action=edit&cat_ID=3)
3) Note that number(s) and enter them in the line of code that reads, for example:
<?php wp_list_categories(‘exclude=6,8,21′); ?>

Add “Edit Post” capability to Atahualpa WP theme

Monday, September 14th, 2009

The Atahualpa Theme by BytesForAll is a great, and so, so highly customizable WordPress theme, however something I have been meaning to do for a while is fix it to add in the capability to “edit a post” for authors and admins (this MAY be fixed in their latest version though, not sure). I may post the alteration code at some point (anyone who wants it after I do it, feel free to drop me a line).

Quote Tweet Test

Friday, September 11th, 2009

This rockin’ new WordPress plugin from @TCorp allows you to add Twitter-style, bubble-enclosed quotes of favorite tweets from any Twitter user (grabbed from the Twitter XML timeline file) to your WordPress blog. Check it out!

WP Quote Tweets is available for download NOW! (Allows you to quote tweets using a shortcode) http://tanin.nl/CfZP #wordpress #wp

"Best ways to display twitter updates" (from @gopalraju): http://bit.ly/o1WCn ;)