How To Exclude WordPress Category

by Abi on May 16, 2010

You can exclude certain categories you don’t want them to show at your homepage, singe page or any pages on your WordPress blog. The reason for excluding category may vary, as for me, I don’t want my second navigation looks crowded especially with categories that are not really important or with less posts.

Thus as you can see in my category horizontal list above I only put 9 categories of 12 categories this blog has. And what I did to exclude unwanted categories from showing up is adding this function:

<?php wp_list_categories('title_li=&exclude=1,2,3'); ?>

1, 2 and 3 are categories ID that to be excluded and you can find categories ID on your category section (Post -> Categories), then point your cursor to the category name you wish to exclude to find its ID:

WordPress Category List

Thus change 1,2 and 3 with your own category ID to make them/it excluded and not show up on your WordPress blog!

Related posts:

  1. Delete The Word Category In WordPress Category Url With Plugins And PHP Tag
  2. SEO Your WordPress Category With Description
  3. How To Get Back WordPress Widgets That Disappeared
  4. Adorn 404 Page In WordPress To Retains Visitor From Leaving Our Blog
  5. WordPress Bloggers Should Join WPScoop

{ 2 comments }

Minh@Minh Meo's Blog May 16, 2010 at 11:30 am

Thanks! Please let me know where to add this code? Is it work for Thesis only?

Abi May 16, 2010 at 12:07 pm

It can be applied to any theme Minh, the position of this code depends on where your category location, thus it can be placed anywhere on your own theme :)

Comments on this entry are closed.

Previous post:

Next post: