Code from existing widget:
$get_featured_pages = new WP_Query( array(
'posts_per_page' => -1,
'post_type' => array( 'page' ),
'post__in' => $page_array,
'orderby' => 'post__in'
) );
echo $before_widget; ?>
<div class="services-block clearfix">
<?php
$j = 1;
while( $get_featured_pages->have_posts() ):$get_featured_pages->the_post();
$page_title = get_the_title();
if( $j == 3 ) {
$service_class = "tg-one-third tg-one-third-last";
}
else {
$service_class = "tg-one-third";
}
?>
<div class="<?php echo $service_class; ?>">
Currently outputs all divs with class="tg-one-third" and one with tg-one-third-last. I need to target them individually to add icon styles. I've searched but struggled to find answers that used the above syntax.