Skip to content

Instantly share code, notes, and snippets.

@byroncorrales
Created August 17, 2012 17:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save byroncorrales/3380826 to your computer and use it in GitHub Desktop.
<!-- Start cars loop -->
<?php
$count = 0;
$separator = 0;
$cat_selected = get_category($cat);
$args = array( 'post_type' => 'car','cat'=>$cat_selected->cat_ID );
$loop = new WP_Query( $args );
echo '<div class="cars-list allcars grid_12">';
while ( $loop->have_posts() ) : $loop->the_post();
$count++;
if ($count==1 || ($separator+4)==$count) {
echo '<div class="yellow-section"></div>';
$separator = $count;
}
echo '<article class="car">';
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('car-thumb');
echo '</a>';
echo '<div class="car-title">';
echo '<a href="' . get_permalink() . '">';
the_title();
echo '</a>';
echo '</div><div class="excerpt-car"';
the_excerpt();
echo '</div></article>';
endwhile;
echo '<div class="clear"></div></div>';
?>
<!-- /End last cars loop -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment