Home Forums Front-end Issues Custom Post Taxonomies and ACF Reply To: Custom Post Taxonomies and ACF

  • I reworked my template a bit, but still see the same error:

    <?php get_header(); ?>
      <h1 class="entry-title"><?php single_term_title(); ?></h1>
      <div class="archive-meta"><?php if ( '' != the_archive_description() ) { echo esc_html( the_archive_description() ); } ?></div>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <article class="post">
          <?php if ( has_post_thumbnail() ) : ?>
            <div class="thumb">
              <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?></a>
          <?php endif; ?>
          <div class="content">
            <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
            <p class="excerpt-entry"><?php echo strip_tags( get_the_excerpt() ); ?></p>
      <?php endwhile; endif; ?>
      <?php $get_actors = get_field('actors'); ?>
      <?php if( $get_actors ): ?>
          <?php foreach( $get_actors as $actors ): ?>
            <li><a href="<?php echo esc_url( get_term_link( $actors ) ); ?>"><?php echo esc_html( $actors->name ); ?></a></li>
          <?php endforeach; ?>
      <?php endif; ?>
    <?php get_footer(); ?>

    When I have nothing linked to the taxonomy, the ACF taxonomy data displays (example:

    In the db query, I see the the following:

    SELECT t.term_id
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    WHERE tt.taxonomy IN ('actor')
    AND t.term_id IN ( 403,404,284 )

    Those term IDs are correct. The full display of DQ queries also looks accurate (example:

    I take a single blog post, assign the shows taxonomy for “Broadchurch” for example (example: and save the post. When I refresh the taxonomy archive page, there are no queries at all for ACF, as shown here:

    My ACF setup for the field is: and the location rules are:

    I suspect that WP is overriding the ACF query entirely, or somehow preventing it from ever running in this instance where a post has a bunch of terms applied to it, but the term itself also has a term applied to it.