title: how to display all product category images
body: <p>i am having problem of getting images of all product category in wordpress. please help me to solve this error.</p>
  
  <p>here is my code-</p>
  
  <pre><code>          &lt;div class="row"&gt;
            &lt;?php $sub_count=1; foreach ($product_categories as $key =&gt; $category_) { 
           $cat_thumb_id = get_woocommerce_term_meta( $category_-&gt;term_id, 'thumbnail_id', true );
          $shop_catalog_img = wp_get_attachment_image_src( $cat_thumb_id, 'shop_catalog' );
              if($sub_count&lt;5){ ?&gt;
             &lt;div class="col-md-6 col-sm-6 col-xs-12 nogap"&gt;
              &lt;div class="bannerbox2img"&gt;
             &lt;a href="&lt;?php echo get_term_link($category_); ?&gt;"&gt;&lt;img src="&lt;?php echo $shop_catalog_img; ?&gt;" alt="&lt;?php echo $category_-&gt;name; ?&gt;" /&gt;&lt;/a&gt;
            &lt;?php echo '&lt;a href="'.get_term_link($category_).'" &gt;';
                  echo $category_-&gt;name;
                  echo '&lt;/a&gt;'; ?&gt;
            &lt;/div&gt; 
             &lt;/div&gt;
            &lt;?php } $sub_count++; } wp_reset_query(); ?&gt;
            &lt;/div&gt; 
  </code></pre>
  
  <p>thanks in advance</p>