WordPress   

Get all top level product categories including custom field and thumbnail

<div class="product-categories">
	<?php $productCats = get_terms('product_cat', array('hide_empty' => 0,'meta_key'   => 'order', 'orderby'    => 'meta_value_num', 'parent' =>0)); 
		foreach($productCats as $productCat) :
		//remove uncategorized from loop
		if( $productCat->slug == 'uncategorized' ){
           continue;
		}
		$productCategoryImage = wp_get_attachment_image( get_term_meta( $productCat->term_id, 'thumbnail_id', true ), 'full' );			
		?>
		<div class="product-category">
			<?php if($productCategoryImage): ?>
			<div class="product-category-img">
			<?php echo $productCategoryImage; ?>
			</div>
			<?php endif ?>
			<a class="product-category-title" href="<?php echo get_term_link( $productCat->slug, $productCat->taxonomy ); ?>"><?php echo $productCat->name; ?></a>
			<p class="product-category-text"><?php echo $productCat->description; ?></p>
			<p><?php the_field('category_subtitle'); ?></p>
		</div>
	<?php endforeach; ?>
</div>
Need Professional Support for Your Website Problems?

Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.

Hire Us

Got an idea? We'll turn it into reality.

Tell us what you're building, what's broken, or what numbers need to move. We'll come back within one business day with a short plan — no long decks, no sales calls without purpose.

Response time: First reply within 1 business day on 100% of messages.
Transparent scope: Fixed proposals with weekly check-ins & live task tracking.
Ship-ready builds: Every engagement leaves behind documented, transferable work.
Long-term partners: Ongoing retainers for support, SEO, ads, and content.