Not displaying the first image
-
I’m using this plugin to display all (WooCommerce) Product Tag images on a single page i.e.
https://www.addanotherlayer.com/brands/
However, it does not seem to display the first Product Tag which has associated products, but it successfully displays all others.
Here’s the code I’m using to call the Product Tag images
<?php foreach (get_terms('product_tag') as $cat) : ?> <?php while ( have_posts() ) : the_post(); ?> <li class="product"> <a href="<?php echo get_term_link($cat->slug, 'product_tag'); ?>"> <img src="<?php echo z_taxonomy_image_url($cat->term_id, 'thumbnail'); ?>" /> </a> <a href="<?php echo get_term_link($cat->slug, 'product_tag'); ?>"><?php echo $cat->name; ?></a> </li> <?php endwhile; // end of the loop. ?> <?php endforeach; ?> <?php wp_reset_postdata(); ?>Any thought’s on this or improvements to the code would be most appreciated.
Thank you.
The topic ‘Not displaying the first image’ is closed to new replies.