Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marisqaporter/d5a90201713e7373a02fe0af1fd01f3b to your computer and use it in GitHub Desktop.
Save marisqaporter/d5a90201713e7373a02fe0af1fd01f3b to your computer and use it in GitHub Desktop.
buyer-story-loop-lelands-inside-product.php
<!--buyer story -->
<div class="buyer-wrapper">
<?php
if ( get_query_var('paged') ) $paged = get_query_var('paged');
if ( get_query_var('page') ) $paged = get_query_var('page');
$query = new WP_Query
( array( 'post_type' => 'customer-testimonial',
'paged' => $paged,
'posts_per_page'=> '1', // return only 1 post
'orderby' => 'rand', // order
'order' => 'ASC'
)
);
if ( $query->have_posts() ) : ?>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="buyer-inner">
<div class="col-fourth story-fourth">
<!--image -->
<div class="buyer-image" style="background-image:url('<?php the_field('customer_image'); ?>');">
</div>
<!-- endimage--->
</div>
<div class="col-three-fourth story-fourth">
<div class="buyer-story"><img src="http://lelandscabins.com/wp-content/uploads/2015/11/single_quote.png" alt="entry-quote" hspace="5" />
<?php the_field ('story'); ?></div>
<h4 class="buyer-name"><?php the_title(); ?></h4>
</div>
</div>
<?php endwhile; wp_reset_postdata(); ?>
<!-- show pagination here -->
<?php else : ?>
<!-- show 404 error here -->
<?php endif; ?>
</div> <!-- end buyer story -->
<!-- end buyer story -->
@marisqaporter
Copy link
Author

modified from pippin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment