title: using get_avatar in wordpress
body: <p>this code will display the newest post from a certain category. the post will only display 
  excerpt, beside it is a user avatar. </p>
  
  <p>note: im using plugin called <code>local avatar</code></p>
  
  <pre><code>    //display newest post// 
      &lt;?php
         global $post;
         $args = array( 'numberposts' =&gt; 1, 'category' =&gt; 1 );
         $myposts = get_posts( $args );
         foreach( $myposts as $post ):setup_postdata($post); ?&gt;
  
         //gets user avatar and excerpt//
         &lt;?php echo get_avatar( get_the_author_meta( 'user_email' )); ?&gt;
         &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php echo get_excerpt(100); ?&gt;... &lt;/a&gt;
  
       &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>according to wordpress, if i want to display the user avatar i should include the following inside the loop <code>&lt;?php echo get_avatar( $id_or_email, $size = '50'); ?&gt;</code>
  this code displays the default avatar only.</p>
  
  <p>so i used this, which was taken from the default wordpress template
   <code>&lt;?php echo get_avatar( get_the_author_meta( 'user_email' )); ?&gt;</code> both locally uploaded avatar and gravatar works.</p>
  
  <p>i just want clarity as to why the latter works and not the one found in wordpress codex.</p>