Support

Account

Home Forums Add-ons Gallery Field Make gallery links point to pages

Helping

Make gallery links point to pages

  • I’m working with this line of code:

    <?php 
    
    $images = get_field('gallery_image');
    $size = 'full'; // (thumbnail, medium, large, full or custom size)
    
    if( $images ): ?>
        <div>
            <?php foreach( $images as $image ): ?>
                <div>
                    <a href="<?php echo get_field('url') ?> ">
                	<img src="<?php echo $image['url']; ?>" />
                    </a>
                    
                    <p><?php echo $image['description']; ?></p>
            </div>
            <?php endforeach; ?>
        </div>
    <?php endif; ?>

    and I want this <a href="<?php echo get_field('url') ?> "> to point to specific pages on my wordpress site for each photo in the gallery. How do I go about doing this? Any help would be greatly appreciated.

  • +1 bump

    I’m also interested in how I might use the gallery field while adding per instance extra fields like an image link.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Make gallery links point to pages’ is closed to new replies.