Skip to content

Instantly share code, notes, and snippets.

@janisdonis
Created July 13, 2013 07:08
Show Gist options
  • Save janisdonis/5989736 to your computer and use it in GitHub Desktop.
Save janisdonis/5989736 to your computer and use it in GitHub Desktop.
Wordpress Advanced custom fields gallery template use
<div class="gallery thumb_list">
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<?php
$images = get_field('bildes');
if( $images ): ?>
<?php foreach( $images as $image ): ?>
<div class="gal_thumb">
<a href="<?php echo $image['sizes']['large']; ?>" rel="prettyPhoto[gallery<?php echo $post_id;?>]"><img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['title']; ?>"/></a> </div>
<?php endforeach; ?>
<?php
?>
<?php endif; ?>
<?php endwhile; endif; ?>
<div class="clear"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment