Support » Requests and Feedback » the_category()

  • I’ve got a suggestion for changing <?php the_category() ?>:
    Is there some way for it to not output list-items? I don’t mind hacking up my previous 0.72 templates that much, but it doesn’t seem to make sense to output this in list-items when it seems to make more sense [at least to me] to output it in in-line text. Wouldn’t spans be friendlier?

Viewing 11 replies - 1 through 11 (of 11 total)
  • I changed the template-functions.php and removed the list item for the_category. I find the forcing of us (wp users) to use lists all the time slightly annoying but wp is free so I’m content to alter the files to suit my needs.

    Since an entry can be in more than one category, a list makes sense. It can be styled to appear to be a single line.
    But if you REALLY want a line instead of a list, use the separator parameter. See the wiki:

    I guess a list does make sense in some ways, now that I think about it some more, but it seems like adding a bit more code than necessary to then turn around have display: inline; a few different places inside the stylesheet. :shrug:

    Symantically speaking, it *is* a list, so it should be marked up as such. How you decide to display the list is up to you, and is very easily handled by the style sheet. Changing the code to non-symantic markup just because you’re not displaying it as a traditional bulleted list makes no sense at all. Just as another example, let’s say the title of my site is wrapped in a heading tag, like <h1>My Site</h1>. But, I decide to use a graphic for my title instead. Would it make sense, then, to simply hide the h1 using display:none, or should I change it from an h1 to a span? The answer is simple: keep it symantically correct as a heading, but use styles to display it as appropriate for your site.

    That would be semantic … but then I’m pedantic about spelling.
    I probably should be more pedantic about semantics and think before I speak. 😉

    Yeah, it’s semantic…I shouldn’t type when doing five other things…leads to silly mistakes.

    Hey, it gave me a cheap excuse to rhyme. I’m a writer, not a coder.

    Nuts … I even searched for the_category() to make sure I wasn’t repeating myself.
    :sigh: Sorry to make you repeat yourself, Matt.

    it *is* a list, so it should be marked up as such.

    It is only a list if you are using multiple categories. If you are using single categories, formatting the category as a list makes no semantic sense whatsoever.

    Sure. If a list has only one item, it’s still a list. A list of one item. It has the potential to contain more than one item.
    Now, if the list has zero items, we start getting into some real philosophy 😉

    Huh? Sorry, I was gazing at my navel.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘the_category()’ is closed to new replies.