WordPress.org

Ready to get started?Download WordPress

Forums

User Photo
Images not showing on posts (12 posts)

  1. TMichaelLaw
    Member
    Posted 1 year ago #

    Hello, why are images not showing on posts? They are properly showing in the User Settings. Many thanks

    http://wordpress.org/extend/plugins/user-photo/

  2. sad09123
    Member
    Posted 1 year ago #

    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>' );?>
    </div>

    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" />
    </div>

    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 ^^

  3. sad09123
    Member
    Posted 1 year ago #

    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}' />";
    
    	}
  4. NormanBird
    Member
    Posted 1 year ago #

    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

  5. NormanBird
    Member
    Posted 1 year ago #

    seems easier just to upload image at gravatar.com since the themes, mine included are setup for this. that's what I did. So my issue is resolved. :-)

  6. TMichaelLaw
    Member
    Posted 1 year ago #

    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?

  7. sad09123
    Member
    Posted 1 year ago #

    Just go to read get_avatar and pluggable functions :)

  8. NormanBird
    Member
    Posted 1 year ago #

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

  9. Jannokas85
    Member
    Posted 1 year ago #

    Hello!
    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?

    Thanks!

  10. mbrsolution
    Member
    Posted 1 year ago #

    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:

    http://wordpress.org/extend/plugins/wp-user-avatar/

    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

  11. plymouthdesign
    Member
    Posted 1 year ago #

    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

    wp-content/uploads/userphoto/*

    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.

    See http://wordpress.org/support/topic/plugin-w3-total-cache-cdn-support-for-user-avatars

    for info related to this topic.

  12. Jannokas85
    Member
    Posted 1 year ago #

    hello!
    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.

    -j

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic