WordPress.org

Ready to get started?Download WordPress

Forums

User Photo Plugin (4 posts)

  1. zuzuleinen
    Member
    Posted 3 years ago #

    I've tried to use the User Photo plugin at P2 theme but i have a problem:

    As you can see here if a user upload his image and doesn't use the Gravatar, his post will not be shown properly.

    Can you please tell me what should I do in order to show the image properly if I'm using User Photo plugin?

  2. Nobble
    Member
    Posted 3 years ago #

    so what you want is for a manually uploaded photo from a user to get priority over a gravatar image?

    have you tried surfalot's solution:

    <?php
    	$the_photo = '';
    	if (function_exists('userphoto__get_userphoto') && defined('USERPHOTO_THUMBNAIL_SIZE') && !empty($comment->user_id))
    		$the_photo = userphoto__get_userphoto($comment->user_id, USERPHOTO_THUMBNAIL_SIZE, /* before */ '', /* after */ '', array('class' => 'avatar'), /* def src */ '');
    	if (!empty($the_photo)) echo $the_photo;
    	else echo get_avatar( $comment, 32 );
    ?>

    you'll need to edit functions.php at line 134 in p2 1.1.5.
    this is what you need to replace with above:
    <?php echo get_avatar( $comment, 32 ); ?>

  3. zuzuleinen
    Member
    Posted 3 years ago #

    <b>@Nobble</b> Thx :) I found another plugin, and I think is better than User Photo, it's called Avatars. It work's just fine, I don't need to make any modifications :) But, thx for help!

  4. smc11773
    Member
    Posted 3 years ago #

    I second that, Avatars works really well.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags