Support

Account

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.