Home Forums Add-ons Gallery Field Custom Attachment Fields in Gallery Field


Custom Attachment Fields in Gallery Field

  • Hi,

    I’m having trouble integrating a media attachments selector field with the gallery field.

    This is what I have so far:

    <?php $images = get_field('project_content'); if( $images ): ?>
        <?php foreach( $images as $image ): ?>
        <div class="<?php $columns = get_field('columns', $image['id']); ?>">
    	<a class="fancybox" rel="group1" href="<?php echo $image['url']; ?>"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>"/></a>
            <h5><?php echo $image['caption']; ?></h5>
        <?php endforeach; ?>
    <?php endif; ?>

    Gallery being ‘project_content’, and ‘columns’ the selector in attachments. Right now the gallery works fine, but the selector doesn’t produce any results.

    Any help figuring this out would be greatly appreciated!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.