Support » Themes and Templates » the_category – problem forcing no styling

  • Hello!

    I’m trying to include the_category tag in the loop on my Index page to make something like:

    “Posted on August 18, 2007 at 2:25 pm in Music”

    tacked on the top of my post.

    However, the output is putting a list around the category. I thought the default was “usage lists categories with no separator other than a space.”.

    My code:

    <p>Posted on <?php the_time(‘F j, Y’); ?> at <?php the_time(‘g:i a’); ?> in <?php the_category(); ?></p>

    Source output:

    <p>Posted on August 18, 2007 at 2:25 pm in <ul class=”post-categories”>

  • Music
  • </p>

    What gives? I simply want the tag to output the category with no lists or any formatting so it doesn’t look out of place!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Looks like that got broken somewhere in the code, or changed or something.

    Anyway, the_category(' '); should do what you want. That’s a space between quote marks for the first parameter.

    Brilliant mate, thanks for the swift reply!

    I’m still learning…I have learned so far it’s always something bloody simple… 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘the_category – problem forcing no styling’ is closed to new replies.