• Resolved andresgl

    (@andresgl)


    Hi,

    I would like to implement the your plugin into the field type ‘gallery’ of the plugin ACF But I can not find the way of do it..

    Taking as example the basic code from the ACF documentation:

    <?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']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
                    </a>
                    <p><?php echo $image['caption']; ?></p>
                </li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>

    ..

    How can I replace the ‘thumbnail’ size for my custom thumbnail size created with “Fly Dynamic Image Resizer”?

    Thank you!

Viewing 1 replies (of 1 total)
  • Thread Starter andresgl

    (@andresgl)

    Well,

    I have solved the problem by my self. It should be different ways to do it but at the moment my way is working:

    ACF gallery documentation:

                    <a href="<?php echo $image['url']; ?>">
                         <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
                    </a>

    Remplace for:

    <a href="<?php echo $image['url']; ?>">
    <?php
      $imageid = $image['id'];
      $fly_image = fly_get_attachment_image_src($imageid, 'grid-1-1', true); 
    ?>
    
    <img src="<?php echo $fly_image['src']; ?>" alt="<?php echo $image['alt']; ?>" />
    </a>

    ??

    Cheers,

Viewing 1 replies (of 1 total)
  • The topic ‘How to implement “Fly Dynamic Image Resizer” into ACF gallery’ is closed to new replies.