Question

I used the Advanced Custom Fields plugin to add a custom field to my taxonomy. That custom field is an image which is associated with the term. Now I have a page where I display a list of all terms (for example, car manufacturers):

$terms = get_terms("manufacturer_tax", array(
    'hide_empty' => 0
));
$count = count($terms);
if ( $count > 0 ){
    foreach ( $terms as $term ) {
        echo $term->name;
        echo "<img src='" . $term->manufacturer_logo . "'>"; /* NOT WORKING */
     }
}

I wish to display the image associated with each term. How can I accomplish this?

EDIT

Here is the example result for one term: stdClass Object ( [term_id] => 5 [name] => Honda [slug] => honda [term_group] => 0 [term_taxonomy_id] => 5 [taxonomy] => manufacturer_tax [description] => [parent] => 0 [count] => 0 )

Looks like there is no image associated with this term. However, I can see the image in the backoffice.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top