• I am trying to style the categories that are displayed under each posts in index.php which is my blog page.
    The code is
    <p><?php the_category(' ') ?></p>
    This is how it is being displayed on the page after the post:
    category1
    category2
    category3

    What I want is the categories being displayed as
    category1 category2 category3
    with each category having a background color of gray and seperated by white space.

  • The topic ‘Style categories using the_category(‘ ‘) in index.php’ is closed to new replies.