I've created a product post type on Wordpress called products, with a custom taxonomy called "product_categories" using Advanced Custom Fields (ACF) I added an image field to the taxonomy to be able to add an image to each product category. Below is the query im doing. It works fine, however I want to display the image in a custom size, so it's not loading a huge 2000x3000 image every time. Here is my current code:
<?php
$prodargs=array(
'hide_empty' => 0,
'parent' => 0,
'taxonomy' => 'product_categories');
$prodcats=get_categories($prodargs);
foreach($prodcats as $pc){
$termlink = get_term_link( $pc->slug, 'product_categories' );
?>
<a class="single-library-cat" href="<?php echo $termlink; ?>">
<img src="<?php the_field('taxonomy_image', 'product_categories_'.$pc->term_id); ?>" />
<?php echo $pc->name; ?>
</a>
<?php } ?>
I know through ACF I can access extra image data such as sizes, width height. Just not sure I would implement it to my currect code. https://www.advancedcustomfields.com/resources/image/