Skip to content

Instantly share code, notes, and snippets.

@bastianallgeier
Last active June 21, 2017 14:59
Show Gist options
  • Save bastianallgeier/2420685 to your computer and use it in GitHub Desktop.
Save bastianallgeier/2420685 to your computer and use it in GitHub Desktop.
<ul class="projects">
<?php foreach($page->children()->visible()->shuffle() as $project): ?>
<?php $image = $project->images()->first()->fitWidth(200) ?>
<li>
<a href="<?php echo $project->url() ?>"><img src="<?php echo $image->url() ?>" width="<?php echo $image->width() ?>" height="<?php echo $image->height() ?>" /></a>
</li>
<?php endforeach ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment