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
<!-- 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