Get Advanced Custom Field on taxonomy.php

How to get the queried object and retirieve Advanced Custom Fields from a taxonomy term.

$queried_object = get_queried_object(); 
	$taxonomy = $queried_object->taxonomy;
	$term_id = $queried_object->term_id;
	global $post;
	 
	// get current term
	$terms = get_the_terms($post->ID, 'MY_TAX');
	// get acf image field from term
	$thumbnail = get_field('category_featured_image', $queried_object)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

69 − 63 =