WordPress.org

Ready to get started?Download WordPress

Forums

Add Local Avatar
[resolved] Conditional Display (2 posts)

  1. nytx
    Member
    Posted 9 months ago #

    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.

    http://wordpress.org/plugins/add-local-avatar/

  2. nytx
    Member
    Posted 6 months ago #

    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?

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

    Thank you!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags