the_category - problem forcing no styling (3 posts)

  1. harveypooka
    Posted 8 years ago #


    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">

  2. Music
  3. </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!

  • 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.

  • harveypooka
    Posted 8 years ago #

    Brilliant mate, thanks for the swift reply!

    I'm still learning...I have learned so far it's always something bloody simple... :)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic