Excluding categories in the_category
-
In my index.php template, I of course want to show the categories associated respectively with each post. So I use the default code:
<?php the_category() ?>
I would like to have ‘the_category’ only hook into 5 categories (under which all the posts are) and ignore the rest of the categories (which I use for other aspects of the blog). In other words, I’d like to include only a few specific categories.
‘wp_list_categories’ has the ability to do this, but that lists ALL categories, not just the ones associated with a post. Example:
<?php wp_list_categories('orderby=name&include=3,5,9,16'); ?>
Is what I’m looking for possible?
Thank you!
- The topic ‘Excluding categories in the_category’ is closed to new replies.