title: Wordpress - Get author image
body: <pre><code>&lt;?php while ( have_posts() ) : the_post(); ?&gt;
      &lt;section class="panel panel-white"&gt;
          &lt;div class="row single-post-content"&gt;
              &lt;?php if ($category_name !== 'Jobs') { ?&gt;
                  &lt;h5 class="author-post__title"&gt;&lt;?php the_author() ?&gt;&lt;/h5&gt;
                  &lt;p&gt;&lt;?php echo get_the_date(); ?&gt;&lt;/p&gt;
              &lt;?php }
  
              the_content();
  
              if ($category_name !== 'Jobs') { ?&gt;
                  &lt;div class="row author-post"&gt;
                      &lt;div class="small-12 medium-4 column"&gt;
                          &lt;img src="&lt;?php  echo get_avatar(); ?&gt;" alt="" /&gt;
                      &lt;/div&gt;
                      &lt;div class="small-12 medium-8 column"&gt;
                          &lt;h5 class="author-post__title"&gt;&lt;?php the_author() ?&gt;&lt;/h5&gt;
                          &lt;p&gt;
                              Lorem Ipsum has been the industry's standard dummy text
                              ever since the 1500s, when an unknown printer took a
                              galley of type and scrambled it to make a type specimen
                              book. It has survived not only five centuries, but
                              also the leap into electronic typesetting, remaining
                              essentially unchanged. It was popularised in the 1960s
                              with the release of Letraset sheets containing.
                          &lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;?php } ?&gt;
          &lt;/div&gt;
      &lt;/section&gt;
  &lt;?php endwhile;?&gt;
  </code></pre>
  
  <p>I am trying to pull through the avatar of the author that has written the post. 
  I thought that  would make this work but it doesn't seem to output the right url and gives me a 404 on the image.</p>
  
  <p>What methods have other people done to pull through the avatar image? </p>
  
  <p>I'm looking for an answer that tells me how to do that and if there isn't an image to not show one. </p>
  
  <p>UPDATE: </p>
  
  <p>I have tried to make this work using the below code: I should mention that I am trying to make this work on my local machine as well. </p>
  
  <pre><code>echo get_avatar($authorId, 100); 
  </code></pre>
  
  <p>(the variable uses <code>get_the_author_id()</code>)</p>