Get all terms inside a custom taxonomy including an ACF field in WordPress

<?php $terms = get_terms('genre', array('hide_empty' => 0, 'parent' =>0)); 
	foreach($terms as $term) :
		$image = get_field('genre_image', $term); // ACF custom field ?>	
		<a href="<?php echo get_term_link( $term->slug, $term->taxonomy ); ?>"><?php echo $term->name  ?></a>
		<img src="<?php echo $image['url']; ?>">
<?php endforeach; ?>
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us