WordPress.org

Ready to get started?Download WordPress

Forums

Picture (Avatar) for Authors (2 posts)

  1. downlikecharliebrown
    Member
    Posted 6 years ago #

    Hey there, I'm wondering if there's any way to set up a small picture, like an avatar, next to each author's name on each post. I'm not really great with CSS or XHTML, and I couldn't find a plugin that would allow me to do this. Does anyone have any suggestions?

  2. Ivovic
    Member
    Posted 6 years ago #

    I can't think of a plugin for this, but I'd be surprised if there isn't one.

    anyway, the code is quite simple, its just a case of picking where in the theme you want to put it, and inserting the code there.

    <img class="authAv" src="http://your-domain.com/wp-content/<?php the_author() ?>.jpg" alt="Your author: <?php the_author() ?>" />

    you can then put a .authAv class in your CSS to position the picture appropriately.

    Generally speaking, and not having seen your site, you can usually put this code just before the post title in your theme files, then use the following CSS at minimum:

    .authAv {
        float: right;
    }

    which will move the image to the right hand side, on the same level as the post title.

    then all you need to do is upload images into wp-content, named after the authors on your site.

    so if you have an author named bob, you'd upload bob.jpg to wp-content.

Topic Closed

This topic has been closed to new replies.

About this Topic