ThemeShaper Forums » Thematic


i think i found an easy way to add category icons for each post

(5 posts)
  • Started 12 years ago by js09
  • Latest reply from optimus203
  • This topic is not a support question


  1. js09

    As the main posts are displayed on the home page, i was looking for a way to add a small icon for each post category. i found the plugin called 'category-icons' which didn't work too well.

    anyway, here is an alternative method.
    in the #content div, each post has its own div (div id="post-1", div id="post-2", etc.) and every single one of those divs has a category class.

    here is an example of one of my posts, notice how it's got a class of 'category-football'.

    <div id="post-18" class="hentry p1 post publish author-jeff category-football untagged comments-open pings-open y2009 m09 d06 h14 slug-ohio-state-vs-navy">

    so with CSS i simply added a background image to the class '.category-football'. the background image is position in the upper left by default, which ends up being just to the left of .entry-title and .entry-meta

    and that's how i was able to create custom category icons! anyone else use a similar method?

    Posted 12 years ago #
  2. this was INSANELY helpful!

    i tried that silly plug-in to no avail, as well. it must not work for thematic.

    anyway, i've always preferred to not use plug-ins wherever possible. Thanks for sharing.

    Posted 12 years ago #
  3. Hey! What a great piece of advice! Thanks!

    Posted 10 years ago #
  4. Great. This is simple. Always the best way. Thanks for sharing, js09.

    Posted 10 years ago #
  5. Very nice and simple solution to a problem I was having. Thanks for sharing.

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.