How do you exclude categories from navigation in wordpress?
I've tried putting this code in header.php: <?php wp_list_categories(‘title_li=&include=3,5,7,12′);?>
But it screwed everything up and there's no code in MY header.php to replace what I wrote above with? Is there a plugin for this that actually works? I don't seem to have the code in my header.php to replace with the normal code that seems to work for every body else.
- 10 years agoFavorite Answer
Wherever you have the current wp_list_categories() is where you modify it to look like this:
You may just want to add the exclude section at the end like this:
Here's how you find the id's of the categories you want to exclude. On the left-side menus click Posts > Categories. Then on the right-side list of categories run the mouse over the category name you want to exclude and in the bottom-left status bar of your browser you'll see the category id listed - like cat_ID=8.
- 10 years ago
Rather than a plugin, I'll suggest a WordPress theme. Many themes actually include all sorts of customization from the WP backend without hacking any code. Easier for non-PHP experts and less prone to error.
I use Thesis for all my blogs. Changing navigation is as simple as clicking a checkbox and dragging text. Some info and tutorials are linked below if you think you might go that way.Source(s): http://win-with-1.com/thesis-theme-wordpress/ http://win-with-1.com/thesis-theme http://win-with-1.com/add-wordpress-pages-thesis-n...