Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can’t get small avatar picture to show on website


  • Hunniemaid
    Participant

    @hunniemaid

    I recently installed the bbpress plugin on my WordPress website. The theme I am currently using is built on the Genesis Framework. The avatar image shows up on single post. However, where ever the small avatar image is to be displayed it doesn’t.

    I have my show avatar settings enabled. I would grealty appreciate it if someone could take a look http://hunniemaid.com/forums/ and give me some insight on what the issue may be. Thanks in advamce.

Viewing 13 replies - 1 through 13 (of 13 total)

  • Robkk
    Moderator

    @robkk

    hmmm that is odd. i did not find a css issue, so it must be something else.

    as a test try this to see if the avatars render correctly in the area if there is correct code.

    function rkk_topic_av() {
    	    	echo bbp_get_topic_author_link( array( 'size' => '48' , 'type' => 'avatar'));
    }
    add_action('bbp_theme_before_topic_title','rkk_topic_av');

    then give me the results then we will look over it more.


    Hunniemaid
    Participant

    @hunniemaid

    Where should I place this code? single-post-reply.php? Sorry, new to bbPress. Thank you for the response.


    Robkk
    Moderator

    @robkk

    @hunniemaid

    you place the code in your child themes functions.php or you can use a plugin like this

    https://wordpress.org/plugins/functionality/

    with that plugin you go to plugins> edit functions then place the code i gave you.


    Hunniemaid
    Participant

    @hunniemaid

    Here are the results from placing the code in my functions.php file:
    You will see that I now have an avatar picture showing up next to the topic title, still no change to the other small avatars.


    Robkk
    Moderator

    @robkk

    try this CSS code and hopefully this fixes your issue.

    it looks too small at 14px so i bumped it up to 24px , you can change that back to 14 if you want.

    #bbpress-forums img .avatar-14 {
      height: 24px;
      width: 24px;
      padding: 0;
      border: none;
    }

    Hunniemaid
    Participant

    @hunniemaid

    Nothing changed.


    Robkk
    Moderator

    @robkk

    #bbpress-forums .bbp-author-avatar .avatar-14 {
      width: 24px;
      height: 24px;
      padding: 0;
      border: none;
    }

    if that does not work try this

    #bbpress-forums .bbp-author-avatar .avatar-14 {
      width: 24px !important;
      height: 24px !important;
      padding: 0 !important;
      border: none !important;
    }

    Hunniemaid
    Participant

    @hunniemaid

    Alright the second code worked. Thank you so much for helping. Do you by chance have any suggestions on how to un-blur my avatar picture? Thank you again.


    Robkk
    Moderator

    @robkk

    use this PHP function to resize the small avatars

    function my_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
        $author_avatar = '';
        if ($size == 14) {
            $size = 24;
        }
        $topic_id = bbp_get_topic_id( $topic_id );
        if ( !empty( $topic_id ) ) {
            if ( !bbp_is_topic_anonymous( $topic_id ) ) {
                $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
            } else {
                $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
            }
        }
        return $author_avatar;
    }
    
    /* Add priority (default=10) and number of arguments */
    add_filter('bbp_get_topic_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_reply_author_avatar', 'my_bbp_change_avatar_size', 20, 3);

    The CSS you would have to use now is

    #bbpress-forums .bbp-author-avatar .avatar-24 {
      width: 24px !important;
      height: 24px !important;
      padding: 0 !important;
      border: none !important;
    }

    and you can remove the first function i gave you to test with


    Hunniemaid
    Participant

    @hunniemaid

    For some reason when I added the function code to my functions.php it gave me a 500 Internal Server Error.


    Robkk
    Moderator

    @robkk

    did you copy it correctly I just tested it out and pasted it right from my functions.php file

    Im going to paste it again just in case it was me that forgot something.

    function my_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
        $author_avatar = '';
        if ($size == 14) {
            $size = 24;
        }
        $topic_id = bbp_get_topic_id( $topic_id );
        if ( !empty( $topic_id ) ) {
            if ( !bbp_is_topic_anonymous( $topic_id ) ) {
                $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
            } else {
                $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
            }
        }
        return $author_avatar;
    }
    
    /* Add priority (default=10) and number of arguments */
    add_filter('bbp_get_topic_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_reply_author_avatar', 'my_bbp_change_avatar_size', 20, 3);

    Robkk
    Moderator

    @robkk

    Plus i basically just got this code from here

    Resizing Avatars


    Hunniemaid
    Participant

    @hunniemaid

    Worked like a charm, thank you.

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar