WordPress.org

Ready to get started?Download WordPress

Forums

Replace "Categories" text with thumbnails (3 posts)

  1. adppodcast
    Member
    Posted 6 years ago #

    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?

  2. nakris
    Member
    Posted 6 years ago #

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

  3. Adam Brown
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic