Skip to:
Content
Pages
Categories
Search
Top
Bottom

HOw to show profile picture in Php


  • kinoseo
    Participant

    @kinoseo

    Hi Folks

    im working in template for show some information about user.

    I need show the image of profile from Boddyopress, not the profile image of wordpress.

    I dont know how show the imagen, everytimes apears the profile image from wordpres, and its not the same, its diferent.

    Thanks for you time

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

  • kinoseo
    Participant

    @kinoseo

    Well.. i solved. if any body needs, this is a Shortcode for this, put in functions.php

    // how to show avatar with shortcode --> [DASH_avatar]
    add_shortcode( 'DASH_avatar', 'DASH_avatar_func' );
    function DASH_avatar_func() {
      $current_user = wp_get_current_user();
      $html .=  $current_user->user_login;
      $html .=  get_avatar( $current_user->user_email, 32 );
      return $html;
    }

    awpt
    Participant

    @awpt

    here is another example:

    <div class="box_avatar">
    <div class="ava">
    <a href="<?php echo bp_loggedin_user_domain(); ?>">
    <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    </a>
    </div>
    <div class="box_wrap">
    <?php $current_user = wp_get_current_user(); ?>
    <?php echo $current_user->user_login; ?>
    </div>
    </div>

    r083r7
    Participant

    @r083r7

    I’m trying to do something similar. I’m trying to show a specific user’s avatar. Would like to create a shortcode to identify them by user_id.

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