Pulling in Testimonial Fields
-
I am currently developing a testimonial page for my site. I’ve liked using the Easy Testimonials plug-in because it’s shortcode works well with my homepage testimonial slider, and the plug-in creates a testimonial post type which I can then pull information from and customize on my site’s Testimonials page using PHP and Advanced Custom Fields. I have to use custom code over using the list shortcode because the testimonials need to include specific buttons and links to other pages on the site. My problem is that I cannot figure out the correct PHP to pull in the testimonial’s client name and position. How do I pull these sections into my code using PHP?
<section id=”testimonials” class=”testimonial-section”>
<?php $args = array( ‘post_type’ => ‘testimonial’,’orderby’ =>
‘rand’,’posts_per_page’ => -1 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?><figure>
“>
<?php the_post_thumbnail(‘medium’); ?>
<figcaption>
<div>
“>
<h3><?php the_title(); ?></h3>
<div style=”font-style: italic;”>
<?php the_content(); ?>
</div>
<div>
<?php echo the_field(‘client’); ?> –
<?php echo the_field(‘position’); ?>
</div>
</div>
</figcaption>
</figure>” class=”btn btn-red”>
<?php the_title(); ?>
<?php endwhile; wp_reset_query(); ?>
</section>The page I need help with: [log in to see the link]
The topic ‘Pulling in Testimonial Fields’ is closed to new replies.