title: Displaying category images on homepage in WordPress
body: <p>I am attemtping - and failing - to display the category image (thumbnail) on my WordPress homepage. Here is my code:- </p>
  
  <pre><code>    &lt;?php $paged = get_query_var('paged') ? get_query_var('paged') : 1;
             $cat_id = get_cat_ID( single_cat_title(null, false) );
             query_posts( "cat=$cat_id&amp;paged=$paged&amp;posts_per_page=7" );
             $i=1;
             if(have_posts()): while(have_posts()): the_post();
      ?&gt;
  
  
              &lt;div class="latest_cat_post col-md-3"&gt;
  
                  &lt;div class="news_thumb"&gt;
  
                      &lt;a href="&lt;?php the_permalink();?&gt;"&gt;
                      &lt;?php if ( has_category_thumbnail() ) {
                          the_category_thumbnail();
                          } else { ?&gt;
                          &lt;img src="&lt;?php bloginfo('template_directory'); ?&gt;/images/default-featured.png" alt="&lt;?php the_title(); ?&gt;" /&gt;
                      &lt;?php } ?&gt;
                      &lt;/a&gt;
  
                      &lt;div class="cat_name"&gt;&lt;?php the_category('&amp;bull;'); ?&gt;&lt;/div&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>However, this fails, citing "Fatal error: Call to undefined function has_category_thumbnail()", so I assume this function does not exist, but strangely, has_post_thumbnail() does, so I assumed this would be the case for categories too - perhaps I am wrong.</p>
  
  <p>Can anyone give me 2 minutes of their day to fix this problem? I don't want to use a plugin, when it <em>should</em> be relatively straightforward to do. Thanks!</p>