How to retrieve user avatar
-
Hi,
I’m having trouble to retrieve the user avatar. Is there any plugins that allows you to upload private avatars instead of creating one at Gravatar, etc..?
Since there are multiple bloggers for the blog, I would like the blogger avatar to appear beside their post. This is my current code and after trying different ways, I still can’t. Please help, thank you.
<?php wp_reset_query() ?> <?php $author_id=$post->post_author; ?> <div id="bottom-content-1"> <ul class="xoxo"> <li class="widgetcontainer clearfix"> <h5 class="widgettitle"><?php _e('Managing Demand', 'arras') ?></h5> <div class="widgetcontent"> <?php $r = new WP_Query(array('showposts' => 3, 'cat'=>18, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'post_id'=>$post, 'author'=>$author_id, 'caller_get_posts' => 1)); if ($r->have_posts()) : ?> <ul> <?php while ($r->have_posts()) : $r->the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a><br /><strong><?php echo get_the_author_meta('avatar'); ?></strong> <i> posted by <?php the_author(); ?> on <?php the_time('F j, Y') ?></i></br></li> <?php endwhile ?> </ul> <?php wp_reset_query(); endif; ?> </div> </li> </ul> </div>
-PHP newbie
- The topic ‘How to retrieve user avatar’ is closed to new replies.