Home › Forums › Front-end Issues › Specific Fields for specific taxonomies on Archive Page › Reply To: Specific Fields for specific taxonomies on Archive Page
The reason is that ACF does not include conditions for showing fields on the front end and this requires coding, for example
// get terms associated with post
$terms = wp_get_post_terms($post->ID, 'your-taxonomy');
// see if there are terms
if ($terms) {
// loop over terms
foreach ($terms as $term) {
// test to see if this is a term with custom field to show
if ($term->name == 'special term') {
// get the value of the field from the term
$term_field = get_field('field_name', $term);
}
}
}
I cannot tell you how to do this is a tool designed to build output in the admin and more than likely no one that visits this forum will be able to help you with this. Most of the people that use ACF code templates using PHP. ACF is an admin tool that helps you create fields and does not include automated code for displaying the values on the front of the site.
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.