WordPress.org

Ready to get started?Download WordPress

Forums

Active Directory Thumbnails
[resolved] How to display avatar (5 posts)

  1. beanz7890
    Member
    Posted 1 year ago #

    Hi,

    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?

    http://wordpress.org/extend/plugins/active-directory-thumbnails/

  2. Omar Mir
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. beanz7890
    Member
    Posted 1 year ago #

    <div class="author-info">
    				<div class="author-avatar">
    					//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 -->
  4. Omar Mir
    Member
    Plugin Author

    Posted 1 year ago #

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

    <?php
    $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.

  5. beanz7890
    Member
    Posted 1 year ago #

    Excellent, all working.

    Thank you for coming back to me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic