jeudi 26 février 2015

get a field of wordpress custom taxonomy term

I have registered a new taxonomy and assigned a custom field (image) to its term (subcategory) using Advanced Custom Fields 4.4.0. Somehow I can't get it displayed on custom page template.



$term = get_query_var('term');
$term = get_term_by('slug', $term, 'gallery');
$termid = $term->term_id;
get_field('featured_image', $termid);


What am I doing wrong?


Any help appreciated!


Aucun commentaire:

Enregistrer un commentaire