Skip to:
Content
Pages
Categories
Search
Top
Bottom

Using BuddyPress profile image


  • mele03
    Participant

    @mele03

    Hello there guys,

    I’ve just installed a nice plugin called “Birds autor box” (https://wordpress.org/plugins/birds-author-box/). The plugin is using WordPress’s funcation “get_the_author_meta(‘image’, get_query_var(‘author’))” to pull the user’s profile image. For some reason even that I’ve sync my WP and BP user profile the pllugin does no pulling BP user’s avatar.

    Any thoughts why the sync is not working for me? there is a way maybe to use BP funcation in non-BP plugins or so?

    p.s
    I’m not much of a programmer T_T

    Thanks in advance for any help!

    Michael.

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

  • shanebp
    Moderator

    @shanebp

    Your request is more properly asked of the plugin creator.
    You could try this:
    Open birds-author-box\public\frontend.php and replace this:

               if (get_the_author_meta('image', get_query_var('author')))
                {
                    $content.= '<img class="birds_box_avatar" src="' . get_the_author_meta('image', get_query_var('author')) . '">';
                }
                else
                {
                    $blank = plugin_dir_url(__FILE__) . 'img/blank.png';
                    $content.= '<img class="birds_box_avatar" src="' . $blank . '">';
                }

    with this:

    $avatar_args = array( 
       'item_id' =>  get_the_author_meta('ID', get_query_var('author')),
       'type' => 'thumb',
       'html' => false
    );
    
    $content.= '<img class="birds_box_avatar" src="' . bp_core_fetch_avatar( $avatar_args ) . '">';

    mele03
    Participant

    @mele03

    Works perfect. thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using BuddyPress profile image’ is closed to new replies.
Skip to toolbar