I have the following code:
<?php
$args = array(
'category__in' => array(3),
'posts_per_page' => 3
);
$loop = new WP_Query( $args );
while ($loop->have_posts() ) : $loop->the_post();
?>
<div class="col-md-4 col-sm-4 col-xs-12" style="padding-left:0; padding-right:0;">
<a style="text-decoration:none" href="<?php echo get_permalink(); ?>">
<div class="postsize" style="background:#242930; color:white !important;">
<?php echo get_the_post_thumbnail( $page->ID, 'categoryimage', array('class' => 'faqposts')); ?>
<div class="contentfaq" style="padding: 0 20px 20px; min-height:235px;">
<h3 style="color:white !important;"><?php the_title(); ?></h3>
<div style="color:white";>
<p><?php echo content2(15); ?></p>
</div>
</div>
</div>
</a>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
Which gets my latest posts, and displays them in blocks.
Now, I am trying to make the second block background white, but can not target it, well I am unsure on how to.
Is there a quick way to target this?
Create a variable and check if you're in second step in loop.