Support » Plugin: User Photo » Images not showing on posts

Viewing 11 replies - 1 through 11 (of 11 total)
  • You should open the file functions.php of your current wordpress theme and search for ‘get_avatar’ . In my case

    <div class="avatar two columns">
    <?php echo get_avatar($comment,$size='75',$default='<path_to_url>' );?>

    and replace with

    <div class="avatar two columns">
    <img src="<?php echo get_site_url(); ?>/wp-content/uploads/userphoto/<?php echo $comment->user_id; ?>.thumbnail.jpg" />

    But. When you change your theme you have to repeat the process :). And must be nice have the picture in the admin bar. So modify wp_includes/admin_bar.php. Or better you can modify the get_avatar function in wp_includes/pluggable.php to make it work in all parts of your site. Good Luck ^^

    Better do this. In wp_includes/pluggable.php find get_avatar function and replace the last if-else statement with this:

    $_url_= get_site_url();
    $_source_=$_url_."/wp-content/uploads/userphoto/". $id . ".jpg";
    	if ( !empty($email) ) {
    		$out = "$host/avatar/";
    		$out .= $email_hash;
    		$out .= '?s='.$size;
    		$out .= '&d=' . urlencode( $default );
    		$rating = get_option('avatar_rating');
    		if ( !empty( $rating ) )
    			$out .= "&r={$rating}";
    		$avatar = "<img alt='{$safe_alt}' src='{$_source_}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
    	} else {
    		$avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";

    i find it hard to believe we have to do that just to get the plugin to work. Is there another way? my images dont show in post after loading the plugin

    seems easier just to upload image at since the themes, mine included are setup for this. that’s what I did. So my issue is resolved. 🙂

    Thanks NormanBird. My problem is that I’m running a publication on this site with hundreds of authors, so it would be a nightmare for us to have to create gravatar profiles for everyone, no?

    Just go to read get_avatar and pluggable functions 🙂

    @tmichaellaw, No the avatar account wont help you much in your situation

    I used to have a profile photo up that worked via gravatar. I recently went over to being self hosted and do not get a profile photo from gravatar next to my comments. How can I activate that again?

    I installed this plugin, but do not know where to find “file functions.php of my current wordpress theme”.

    Where is it?


    Hello all, unfortunately this plugin has not being updated for some time now. I am still using it but now I am going to change to another plugin, please click on the following link:

    I am sure you will see a huge difference and this plugin is currently being supported.

    I hope this helps many of you.

    Kind regards

    If you are using W3 Total Cache and a CDN, then you need to configure W3TC to upload your user photos to the CDN.

    In the CDN section – scroll down the Advanced area and add


    to the Custom File list, on its own line. Then be sure to go through the process of uploading your Custom Files to the CDN using the buttons up at the top of the screen when in the W3TC (Performance) settings.


    for info related to this topic.

    Thanks for your reply.
    I didn’t understand much of the terms, but I’ve got my userphoto working now- although it was a bit large than it should’ve been.

    However, I uploaded the user avatar as suggested by mbrsolution and that worked beautifully.


Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Images not showing on posts’ is closed to new replies.