WordPress.org

Ready to get started?Download WordPress

Forums

Adding icons. (3 posts)

  1. howcomical
    Member
    Posted 9 years ago #

    I am making a movie review site for a friend. I want to have a different icon for each category (Good, bad, etc). I did a search and found a code that looks like this:

    <img src="<?php the_category() ?>.jpg">

    Well, that doesn't work. On the site it shows up like this:

    General.jpg"

    The image itself is named General.jpg so I don't think it's a problem with the file name. Any ideas as to what I should do?

  2. Jinsan
    Member
    Posted 9 years ago #

    If you do a search for category icons you will find a thread and a link to the plugin that can help you achieve this.

  3. womby
    Member
    Posted 9 years ago #

    that bit of code should work but you should probably add a path to an images directory of some kind before it

    perhaps

    <imb src="/wp-content/cat_images/<?php the_category() ?>.jpg" />

    and dont forget alt text.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.