Skip to content

Instantly share code, notes, and snippets.

@anneallen
Created December 5, 2014 06:15
Show Gist options
  • Save anneallen/d2a831f07b7ba98bd211 to your computer and use it in GitHub Desktop.
Save anneallen/d2a831f07b7ba98bd211 to your computer and use it in GitHub Desktop.
Tiger Stripe to WP_query
$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