How to Exclude Specific Categories from Navigation

Thu, Jul 16, 2009

Wordpress

How to Exclude Specific Categories from Navigation

Exclude Categories from NavigationYou can say it as How to Show Specific Categories in Navigation or How to Exclude Specific Categories from Navigation. Both are almost one and same thing. For this, we just have to edit a simple php code which is calling Categories in Navigation from Header.php of your theme file.

The Ordinary Code looks mostly like:

<?php wp_list_categories(‘title_li=&exclude=’ . $ex_aside) ?>

  • Now if you want to un-show some categories or want to show only those you want. Just do these simple steps.
  • Find the above code in Header.php of your theme file.

Replace it with this code:

<?php wp_list_categories(‘title_li=&include=3,5,7,12′);?>

In the above code, 3, 5, 7 and 12 are the IDs of your categories. Only add IDs of those you want to show in navigation. Rest will be excluded.

Related posts:
  1. Create Custom Sidebar in Wordpress Blog
  2. How to Create Custom Page Template in Wordpress?
  3. Simple Wordpress SEO in 3 Steps

, , ,

This post was written by:

Enk. - who has written 88 posts on Wordpress Tutorials.

I'm one of the Administrators of CHIDIMAR.com. I also own I'm Enk.. I'm 18 years old Blogger and Graphics Designer looking for Freelance work. You can follow me @enked

Contact the author

3 Comments For This Post

  1. Hariharakumar Says:

    Thanks buddy this really helped me :)

    [Reply]

  2. Buy PSP Go Says:

    Thanks for this! Really useful to keep these and other useful wordpress code snippets around.
    .-= Buy PSP Go´s last blog ..Sony Considered Second Analog Stick for PSP Go =-.

    [Reply]

  3. Morgan | r4 Says:

    Nice work man. Keep it up.

    [Reply]

1 Trackbacks For This Post

  1. How to Exclude Specific Categories from Navigation – Wordpress … | wpden Says:

    [...] How to Exclude Specific Categories from Navigation – Wordpress … Share this on del.icio.usDigg this!Buzz up!Stumble upon something good? Share it on [...]

Leave a Reply