I altered my template per your suggestion @wpfieldwork to see what query would kick out of the db:
SELECT option_value
FROM wp_options
WHERE option_name = '_shows_425_actors'
LIMIT 1
The only problem is that the database doesn’t have this option name set in wp_options. I searched for actor, show, etc, but nothing appears.
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>
</div>
<?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>
</div>
</article>
<?php endwhile; endif; ?>
<h2>Actors</h2>
<?php $get_actors = get_field('actors'); ?>
<?php if( $get_actors ): ?>
<ul>
<?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; ?>
</ul>
<?php endif; ?>
<?php get_footer(); ?>
When I have nothing linked to the taxonomy, the ACF taxonomy data displays (example: https://a.cl.ly/X6uKqWrL).
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 )
ORDER BY t.name ASC
Those term IDs are correct. The full display of DQ queries also looks accurate (example: https://a.cl.ly/WnumRzdq).
I take a single blog post, assign the shows taxonomy for “Broadchurch” for example (example: https://a.cl.ly/6qubm9kN) and save the post. When I refresh the taxonomy archive page, there are no queries at all for ACF, as shown here: https://a.cl.ly/P8u2ZvgJ.
My ACF setup for the field is: https://a.cl.ly/GGu7qZL8 and the location rules are: https://a.cl.ly/8Luq2mdn
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.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.