Home › Forums › Front-end Issues › Taxonomy Name in Archive Page Not Working › Reply To: Taxonomy Name in Archive Page Not Working
Yes, thank you for your help. I have solved it. When you do Term Object instead of Term ID, it will work. And the code is for example here.
<?php
$terms = get_field('cat_related_tags', $queried_object);
if( $terms ):
foreach( $terms as $term ):
$cat_image = get_field('cat_image', $term ); ?>
endforeach;
endif;
?>
I have one more question. I am on tag.php and I am trying to get Custom Field Image. This code didn’t work here. Did I do something wrong? Thank you.
<?php $cat_image = get_field('cat_image'); ?>
<?php the_field('cat_image'); ?>
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.