Created
November 30, 2012 15:56
-
-
Save paulhuisman/4176604 to your computer and use it in GitHub Desktop.
Modulo and End PHP
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
<div class="block_content"> | |
<?php $c = 0; foreach ($dossiers as $k => $dossier): | |
if ($c % 4 == 0) print '<div class="clearfix">';?> | |
<div class="dossier <?php if ($k % 4 == 3) print 'last'; ?>"> | |
<?php if (!empty($dossier->article_image_filepath)): ?> | |
<a href="<?php print url('node/'.$dossier->nid); ?>"><?php print theme('imagecache', 'op_list', $dossier->article_image_filepath, '', '', array('class' => 'dossier_img')); ?></a> | |
<?php endif; ?> | |
<h4><a href="<?php print url('node/'.$dossier->nid); ?>"><?php print $dossier->title; ?></a></h4> | |
</div> | |
<?php if ($c % 4 == 3 || $count == (count($dossiers))) print '</div>'; | |
$c++; | |
endforeach; ?> | |
</div> | |
<?php end($rows); $lastk = key($rows); foreach ($rows as $k => $row): ?> | |
<div class="article_row <?php if ($k == $lastk) print 'last'; ?> clearfix"> | |
<?php echo the_content(); ?> | |
</div> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment