Support » Plugin: Add Local Avatar » Conditional Display

  • Resolved nytx


    Hi, Thank you for your excellent plugin!

    I am displaying user avatars in posts with this suggested code:

    <?php echo get_avatar($post->post_author); ?>

    It works great! Except I would like to be able to make it function so that, if a user does not have a user profile graphic/avatar, it defaults to display nothing. If I use your plugin settings to display “Blank” when there is no user avatar I still get text that is wrapped around where the graphics would be, creating an empty square where a user profile should otherwise be. I would like to get rid of this empty space when the user has now avatar.

    Do you have any suggestions?

    Thank you in advance for considering.

Viewing 1 replies (of 1 total)
  • Hello, Thanks for the recent upgrade. I am still trying to find a solution to the above problem. I am a novice at php and so not surprised that the code I cobbled together below does not work. Do you — or anyone — have any recommendations?

                if ($avtr == 'get_avatar ($post->post_author , 80)') {
                  echo 'echo get_avatar';
                } else {
                  echo "";

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Display’ is closed to new replies.