Created
December 9, 2016 21:10
-
-
Save marisqaporter/d5a90201713e7373a02fe0af1fd01f3b to your computer and use it in GitHub Desktop.
buyer-story-loop-lelands-inside-product.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--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 --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
modified from pippin