WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a custom Taxonomy for a Custom Post Type, and created five or so terms within the taxonomy.

I've created a single image upload and assigned it to the custom taxonomy, and uploaded images for each term.

I can't for the life of me figure out how to get the image to display. I've var_dumped the term but there's nothing in there about the image?

Any help much appreciated!

WP version: 3.4.2 ACF version:

share|improve this question
up vote 2 down vote accepted

As per the plugin documentation:

The second parameter needed is a string in the format “$type_$id”.

// get value from a taxonomy (taxonomy = "category", id = 3)
$value = get_field('field_name', 'category_3');

// get value from a taxonomy (taxonomy = "events", id = 76)
$value = get_field('field_name', 'events_76');
share|improve this answer
Brilliant thank you! Had only been looking at the image docs!! – lucirebecca Nov 25 '12 at 16:17

The code of raison's answer didn't worked for me...

My code to get taxonomy name and term id in automatic way is like that:

$taxonomy = get_taxonomy( $taxonomy );
$taxonomy_name = $taxonomy->name;
$term_id = get_queried_object()->term_id;
$image_ids = get_field('your acf field name here', $taxonomy_name . '_' . $term_id , false or true or empty or string inside '' -  Depending on your field type);
share|improve this answer

Exactly as brasofilo said but if you may need to generate the taxonomy name and ID and in that instance the following code will help:

$taxonomy = $category->taxonomy;
$term_id = $category->term_id; 

$image =  wp_get_attachment_image_src(get_field('thumbnail', $taxonomy . '_' . $term_id), 'shop_catalog');

if ( $image )
  echo '<img src="' . $image[0] . '" alt="" />';

This is for an example of a custom query ($category) and for an Image ID. Hope that helps expand upon the other question.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.