Below is the code that I have written:
<!-- Home Boxes Section2 -->
<?php
for($bx=1; $bx<2; $bx++) {
if( get_theme_mod('page-setting'.$bx)) {
$bxquery = new WP_query('page_id='.get_theme_mod('page-setting'.$bx,true));
while( $bxquery->have_posts() ) : $bxquery->the_post();
?>
<div class="one_third <?php if($bx%3==0){ ?>last_column<?php } ?>">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?>
<h4><?php the_title(); ?></h4>
<?php echo fitnesslite_content(22); ?>
<span class="ReadMore"><?php _e('Read More','fitness-lite');?></span>
</a>
</div>
<?php
endwhile;
}
else{?>
<div class="one_third <?php if($bx%3==0){ ?>last_column<?php } ?>"><a href="#"><img src="<?php echo get_template_directory_uri(); ?>/images/thumb_02.jpg"><h4><?php _e('sadasdaPage Title','fitness-lite'); ?><?php echo $bx; ?></h4><p><?php _e('Phasellus viverra aliquet magna quis interduming. Sed quis fringilla massa. In ut porttitor felis necing iaculis mi. Proin tempo...','fitness-lite');?></p><span class="ReadMore"><?php _e('Read More','fitness-lite');?></span></a></div>
<?php
}
}
?>
<!-- Home Boxes Section -->
My issue is how to display these boxes in the same line? I have repeated this code three times to create three boxes, but they are not aligning in the same line. How can I achieve this?