WordPress: the_category Using Multiple Separators Between Categories

In this tutorial we are going to demonstrate a way to use multiple separators within the_category tag’s $separator string, specifically focusing on a separator and a leading prefix for the following category.

In order to list the post category ( or categories as the case may be ) all that is needed is to include the the_category tag: http://codex.wordpress.org/Template_Tags/the_category. The $separator string provides a way add a comma or other separation mark between the items in a longer list of categories and then throws in an automatic space in case we forget.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.