Support » Plugins » Replace “Categories” text with thumbnails

  • I’m looking for a way (preferably a straight up plugin) that can replace my category names (blogroll, film, news, etc…) with thumbnail images. That is, replace the text with small images. Anybody know anything about this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • nakris

    (@nakris)

    just a bump, as I’d like to be able do this as well.

    Adam Brown

    (@adamrbrown)

    Fiddle with your theme. Doesn’t need a plugin.

    In your theme, look for where the_category() gets called. Replace with something like this (modify as needed). I’m assuming (and strongly recommending) that your images use the category’s slug as the filename.

    Background reading: http://codex.wordpress.org/Template_Tags/get_the_category

    <?php
    foreach((get_the_category()) as $cat) {
       echo '<img src="http://example.com/path-to-images/' . $cat->category_nicename . '.jpg" width="20" height="20" alt="' . $cat->cat_name . '" /> ';
    } ?>

    Modify width and height as needed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace “Categories” text with thumbnails’ is closed to new replies.