the_category Reloaded

This tiny WordPress plugin is a wrapper for the_category(). It provides a new function, ju_the_category(), which gives the_category() some comments_number() -like qualities: by submitting different prefixes for cases where the current post belongs to 0, 1 or >1 categories, the user can have more control over the output of the_category().

After installation (just unzip it and drop it in the plugins directory), the usage of ju_the_category() is , where

zero
(string) is the text to display when the post does not belong to any categories. The default is an empty string.
one
(string) is the text to prefix the category with, when the post belongs to exactly one category. The default is an empty string.
more
(string) is the text to prefix the list of categories with, when the post belongs to more than one category. The default is an empty string.
separator
(string) Text or character to display between each category link. The default is to place the links in an unordered list.
parents
(string) How to display links that reside in child (sub) categories. Options are:

  • 'multiple' – Display separate links to parent and child categories, exhibiting “parent/child” relationship.
  • 'single' – Display link to child category only, with link text exhibiting “parent/child” relationship.

Note: Default is a link to the child category, with no relationship exhibited.

The last two parameters should function identically to the parameters of the original the_category().