Support

Account

Home Forums Add-ons Gallery Field thumbnail-width and thumbnail-height Reply To: thumbnail-width and thumbnail-height

  • add this or something similar to functions.php or your plugin
    <?php add_image_size( 'my_thumb', '160', '390', true );?>

    after that you can use your created size inside your layout-loop

    <?php 
    
    $images = get_field('gallery');
    
    if( $images ): ?>
        <ul>
            <?php foreach( $images as $image ): ?>
                <li>
                    <a href="<?php echo $image['url']; ?>">
                         <img src="<?php echo $image['sizes']['my_thumb']; ?>" alt="<?php echo $image['alt']; ?>" />
                    </a>
                    <p><?php echo $image['caption']; ?></p>
                </li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>