Here is some code I am using to attempt to query my custom post type called ‘Testimonials’.
The query runs and pulls 3 items (which is correct) and as I loop over these items, I want to output the ACF fields that are associated with each testimonial – title, description and videourl.
I know the 3 items are being pulled but the ACF fields aren’t being displayed.
Can you assist?
I know it has to be something basic that I’m missing.
I should also add that this query is run on a custom home page template.
The ACF fields I am attempting to display are Flex Fields.
$args = array(
‘post_type’ => ‘testimonials’,
‘orderby’ => ‘title’,
‘order’ => ‘ASC’,
$testimonials = new WP_Query($args);
if($testimonials->have_posts()) : while($testimonials->have_posts()) : $testimonials->the_post();
<h4><?php the_field(‘title’);; ?></h4>
<p><?php the_field(‘description’); ?></p>
<p><?php the_field(‘videourl’); ?></p>
<p class=”services__grid-individual–title”><?php the_title(); ?></p>
<?php endwhile; endif; wp_reset_postdata(); ?>