Created
December 5, 2014 06:15
-
-
Save anneallen/d2a831f07b7ba98bd211 to your computer and use it in GitHub Desktop.
Tiger Stripe to WP_query
This file contains hidden or 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
$recent = new WP_Query(array( | |
'post_type'=> array( 'testimonial'), | |
'orderby' => 'date', | |
'order'=> 'DESC', | |
'posts_per_page'=> -1, | |
'homeselect'=>$taxon | |
)); | |
$return_string = ' | |
<div class="testimonials">'; | |
while ($recent->have_posts()) : $recent->the_post(); | |
if ($recent->current_post % 2==1) | |
$c=' tiger-odd'; | |
else | |
$c ='tiger-even'; | |
$return_string .=' | |
<div class="testimone'.$c.'"> | |
<div class="testimonial-text">' | |
.wpautop(get_the_content()) | |
.'<h5><span class="detail">'.get_the_title().'</span></h5> | |
</div> | |
</div>'; | |
endwhile; | |
$return_string .='</div>'; | |
return $return_string; | |
wp_reset_query(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment