Is it possible to get the fid of an image from a taxonomy term?
1 Answer
Yes, it is.
$tid = 1; // Term id
$term = taxonomy_term_load($tid); // Load term
// Output term data with debug()
// See watchdog log at /admin/reports/dblog
debug($term, 'Taxonomy Term');
For example, file fid will be
$fid = $term->field_image[LANGUAGE_NONE][0]['fid'];
You could also get the rendered image, or url with something like:
// Get rendered HTML image tag using image styles.
$image = theme('image_style', 'medium', $term->field_image[LANGUAGE_NONE][0]['uri']);
// Get path to image style image
$path = image_style_url('medium', $term->field_image[LANGUAGE_NONE][0]['uri']);