Code:
<?php $end_row = 0;
$columns = 3;
$loop = 0;
foreach ($events as $event) {
if ($end_row == 0 && $loop++ != 0) { ?>
<div class="left13 section_home">
<?php } ?>
<h2><?php echo $event['event_title']; ?></h2>
<a href="#"><img src="<?php echo ($event['photo_thumbnail'] != '') ? base_url() . 'media/photos/thumbnail/' . $event['photo_thumbnail'] : base_url() . 'images/no_photo_thumbnail.png'; ?>" alt="" title="" /></a>
<p><?php echo ($event['event_description'] != '') ? substr($event['event_description'], 0, strpos($event['event_description'], ' ', 200)) : 'No description yet...'; ?></p>
<a href="#" class="section_more"><span class="swirl_left"><span class="swirl_right">View This Event</span></span></a>
<?php $end_row++;
if($end_row >= $columns) { ?>
</div>
<?php $end_row = 0;
}
}
if ($end_row != 0) {
while ($end_row < $columns) { ?>
<div class="left13 section_home"> </div>
<?php $end_row++;
} ?>
<?php } ?>
Code:
<div class="left13 section_home">
<h2>Wedding <span>Location</span></h2>
<a href="#"><img src="images/image_13.jpg" alt="" title="" /></a>
<p>Ut enim ad minima veniam, quis nostru <strong>exercitationem</strong> ullam corporis laboriosam, nisi ut aliquid ex ea commodi <strong><a href="#">consequatur</a></strong>
</p>
<a href="#" class="section_more"><span class="swirl_left"><span class="swirl_right">read more</span></span></a>
</div>
<div class="left13 section_home">
<h2>Honeymoon <span>Destination</span></h2>
<a href="#"><img src="images/image_13_2.jpg" alt="" title="" /></a>
<p>Ut enim ad minima veniam, quis nostru <strong>exercitationem</strong> ullam corporis laboriosam, nisi ut aliquid ex ea commodi <strong><a href="#">consequatur</a></strong>
</p>
<a href="#" class="section_more"><span class="swirl_left"><span class="swirl_right">read more</span></span></a>
</div>
<div class="left13 section_home">
<h2>Girft <span>Registry</span></h2>
<a href="#"><img src="images/image_13_3.jpg" alt="" title="" /></a>
<p>Ut enim ad minima veniam, quis nostru <strong>exercitationem</strong> ullam corporis laboriosam, nisi ut aliquid ex ea commodi <strong><a href="#">consequatur</a></strong>
</p>
<a href="#" class="section_more"><span class="swirl_left"><span class="swirl_right">read more</span></span></a>
</div>