How to choose which category displays when more than one
So I’ve been using
echo $category->cat_name;to display the name of the category next to each post on a variety of pages (home, category, etc). Up til now, each post has only belonged to one category. Recently I added a new category, to which some posts will also belong, but I don’t want that category name to appear in the display.
It seems that WordPress is choosing which category to use by alphabetical order. So when this new category starts with a letter higher up in the alphabet than its original category name, that one is displayed.
How can control this? Preferably without a plugin…
$category->cat_name;, but that only works if the post has at least 2 categories, otherwise it shows blank.
- The topic ‘How to choose which category displays when more than one’ is closed to new replies.