Support » Themes and Templates » Extra Space in Category List

  • Resolved aptdesignonline

    (@aptdesignonline)


    Hi,

    I’m using some standard PHP to output the Category List below each post title.

    I’ve tried two different lines of code to output this:
    <span class="cat-links">Category:<?php printf(get_the_category_list(',') ) ?></span>
    and
    <span class="cat-links">Category:<?php the_category(', '); ?></span>

    However, when a post is in two categories, both codes output an extra space before the comma that separates the categories. So it looks like this:

    This post is in: Category 1 , Category 2

    Could someone tell me what they think might be going on? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra Space in Category List’ is closed to new replies.