Home › Forums › General Issues › Taxonomy Term Image › Reply To: Taxonomy Term Image
Hej John,
thanks!
For some reason, the code I “merged” displays the image two times. My code looks like this (yes, I´m not php savy at all ):
<?php
$terms = get_the_terms( get_the_ID(), ‘brand’ );
if( ! empty( $terms ) ) : ?>
<?php foreach( $terms as $term ) : ?>
<?php
$image_id = get_field(‘brand_logo’, $term, false);
$image = wp_get_attachment_image_src($image_id, $size);
?>
” />
<?php endforeach; ?>
<?php endif;
?>
any idea?
thanks!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.