title: Get image from taxonomy term using ACF
body: <p>I am using the below code to try and retrieve an image field called 'image' from a taxonomy term using the Advanced Custom Fields plugin. This code is based on the documentation on the <a href="http://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/">ACF website here</a>.</p>
  
  <p>It should be noted this code is being used within the taxonomy.php template, and I am unable to specify particular taxonomy and/or terms as I need the code to detect the current taxonomy and term, based on the page the user and clicked through to.</p>
  
  <p>Any help much appreciated!</p>
  
  <pre><code>&lt;?php get_header(); ?&gt;
  &lt;?php get_sidebar(); ?&gt;
  
  &lt;section id="hero-image"&gt;
      &lt;div class="gradient-overlay"&gt;
          &lt;?php 
          // vars
          $queried_object = get_queried_object(); 
          $taxonomy = $queried_object-&gt;taxonomy;
          $term_id = $queried_object-&gt;term_id;  
  
          // load thumbnail for this taxonomy term (term object)
          $image = get_field('image', $queried_object);
  
          // load thumbnail for this taxonomy term (term string)
          $image = get_field('image', $taxonomy . '_' . $term_id);
          ?&gt;
      &lt;/div&gt;
      &lt;div class="grid"&gt;
          &lt;header class="unit full-width"&gt;
              &lt;a href="&lt;?php echo home_url(); ?&gt;/" title="Kurdistan Memory Programme" class="logo"&gt;&lt;?php bloginfo( 'name' ); ?&gt;&lt;/a&gt;
          &lt;/header&gt;
          &lt;footer class="unit one-half"&gt;
              &lt;h1&gt;&lt;?php single_cat_title(); ?&gt;&lt;/h1&gt;
              &lt;h4 class="scroll-down"&gt;Scroll down to continue&lt;/h4&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;?php get_footer(); ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lpHJH.png"><img src="https://i.stack.imgur.com/lpHJH.png" alt="enter image description here"></a></p>