Support » Plugins » Display a unique avatar with each post

  • does anyone know a hack or plugin that allows you to add a unique avator for each post? Or a way of adding a custom field to enter the avatar url into.. that will then display it next to the post.

    Many thanks,

    Jim.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Do you want to have a random image appear? Or set up an image for each category? Or image for each post?

    You can do something as simple as

    ‘$show_avatar=’/images/avatars/avatar’ .rand(1,15) .’.jpg’;’

    and then

    ‘<img src=”<?php print $show_avatar; ?><img src=”<?php print $show_avatar; ?>” alt=”” class=”” />’

    where you have a directory filled with images named avatar1.jpg, avatar2.jpg, etc.

    Drop the <img> tag where you want the image to appear.

    You could substitute the random function with the catagory number if you want the images tied to a category, or an author id if you want it tied to a post’s author.

    It needs to be a picture related to the post really. So a unique picture for each post, that can be chosen/uploaded/linked to when the post is written.

    Thanks.

    You could use the custom fields to specify the image location, and then you would need to insert code into your template to call it and make it into an img tag.

    I think this might help?
    http://wordpress.org/support/topic/37433

    That’s absolutely fantastic.

    I had a feeling I could use custom fields in some way but I’ve never really understood them.

    Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display a unique avatar with each post’ is closed to new replies.