WordPress.org

Ready to get started?Download WordPress

Forums

Icon on Posts (9 posts)

  1. dturnbull
    Member
    Posted 8 years ago #

    Is it possible to allocate an icon to a post and display it next to the title?
    I found post icon plugins for 1.5, but i use 2.0

  2. dturnbull
    Member
    Posted 8 years ago #

    anyone? :(

  3. niziol
    Member
    Posted 8 years ago #

    I'm not exactly sure what you mean, like a different icon beside every post title or the same icon next to every post title?

    Cheers,
    Michael.

  4. moloko
    Member
    Posted 8 years ago #

    I think he is looking to have an icon for each catagory and show up next to the title of his post.

  5. dturnbull
    Member
    Posted 8 years ago #

    i want to be able to show a different icon for each post.

  6. Manually? Then you'll probably want to use the custom fields.

    http://codex.wordpress.org/Using_Custom_Fields

  7. auxillary
    Member
    Posted 8 years ago #

    I tried the thingy at http://codex.wordpress.org/Template_Tags/get_the_category#Show_Category_Images

    I put the following code in my index.php file in front of <?php the_title(); ?> ... but nothing happened:
    <?php foreach((get_the_category()) as $cat)
    { echo '<img src="http://example.com/images/' . $cat->cat_ID . '.jpg"
    alt="' . $cat->cat_name . '" />'; } ?>

    The image is exactly named like the category.

    Any additional explanation on how to use the code on the page mentioned above!? Please?

    Eric

    Edit:
    DUH!!!! Ok found the flaw in my try! Picture name should be the number of the category (ID) not the name! It works!

  8. auxillary
    Member
    Posted 8 years ago #

    I got it to work on my categories but is there a way similar to the above to get icons/images in my PAGE titles as well. I did experiment a bit with it but no results yet.

    Is there a way to get the page_id ... instead of the cat_id like in the code above?

    TIA,

    Eric

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags