Forums

[resolved] [Plugin: Add Local Avatar] Problem local Avatar appearance (4 posts)

  1. glex
    Member
    Posted 10 months ago #

    Hi,

    First of all, I really like the Local Avatar Plugin of Mr Sterling, so thanks for creating such a convenience. My problem to the point:

    If I want to add this code:

    <?php echo get_avatar( $comment, $size = '60' ); ?>

    Or this code

    <?php echo get_avatar( $id_or_email, $size = '60' ); ?>

    To my sidebar-login, the avatar does not appear. While in my comments.php, when I put the code there, it does work.

    How can I fix this problem so that the avatar appears on the right sidebar. Which code do I need to use.

    Thanks in advance!

    glex
    my site: http://www.melted.be

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

  2. peterwsterling
    Member
    Posted 10 months ago #

    The code you are trying will never work - $comment is a local variable you (may be/are) using in your comments loop - $id_or_email is the name of the variable used within the get_avatar function!

    Perhaps you should try something like:

    <?php
    	global $current_user;
    	echo get_avatar($current_user->id);
    ?>

    This is a guess as I have no idea what you are trying to actually achieve. If you need more help learning to use PHP please do get in touch by e-mail... I don't check this forum that often, so e-mail is the best method...

  3. glex
    Member
    Posted 10 months ago #

    Great! It works, thank you very much mate!

  4. realloveministry
    Member
    Posted 7 months ago #

    Why the local avatar is displayed sometimes users use comments and sometimes no

Reply

You must log in to post.

About this Topic