Support » Plugin: Active Directory Thumbnails » How to display avatar

  • Resolved beanz7890



    I’ve gotten the adi_thumbnailphoto meta property populating and when I base64 decode the data from the database to a file on my PC I see the correct image.

    However, whenever I use <?php echo $user->adt_user_photo_url ?> in my template, for example on the author page, I am presented with a generated Wavatar rather than the users photo.

    What am I missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Omar Mir


    Could you post the entire block of code where you are trying to paste the field?

    <div class="author-info">
    				<div class="author-avatar">
    					<?php echo $user->adt_user_photo_url
    					/*<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 60 ) ); ?>*/?>
    				</div><!-- .author-avatar -->
    				<div class="author-description">
    					<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
    					<p><?php the_author_meta( 'description' ); ?></p>
    				</div><!-- .author-description	-->
    			</div><!-- .author-info -->
    Plugin Author Omar Mir


    Hi, you haven’t really created the $user object. Try this:

    $userID = get_the_author_meta('ID');
    $user = get_userdata( $userID );
    echo $user->adt_user_photo_url;

    Make sure to close the php before you open another one as well.

    Excellent, all working.

    Thank you for coming back to me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display avatar’ is closed to new replies.