WordPress.org

Ready to get started?Download WordPress

Forums

the_category() (12 posts)

  1. gfmorris
    Member
    Posted 10 years ago #

    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?
    GFM

  2. Chris
    Member
    Posted 10 years ago #

    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.

  3. Jason
    Member
    Posted 10 years ago #

    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: http://wiki.wordpress.org/index.php/TemplateTags#Categoryx20.tags

  4. gfmorris
    Member
    Posted 10 years ago #

    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:
    GFM

  5. tcervo
    Member
    Posted 10 years ago #

    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.

  6. gfmorris
    Member
    Posted 10 years ago #

    That would be semantic ... but then I'm pedantic about spelling.
    I probably should be more pedantic about semantics and think before I speak. ;)

  7. tcervo
    Member
    Posted 10 years ago #

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

  8. gfmorris
    Member
    Posted 10 years ago #

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

  9. gfmorris
    Member
    Posted 10 years ago #

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

  10. notthatugly
    Member
    Posted 10 years ago #

    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.

  11. Dougal Campbell
    Member
    Posted 10 years ago #

    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 ;)

  12. gfmorris
    Member
    Posted 10 years ago #

    Huh? Sorry, I was gazing at my navel.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.