Support

Account

Home Forums General Issues Conditional to use 'full' image size with animated GIFs Reply To: Conditional to use 'full' image size with animated GIFs

  • Hi @lechatlisse

    You will need to add in a conditional statement with another image load like so:

    
    <?php 
    
    $image = wp_get_attachment_image_src(get_field('image'), 'grid');
    $image = $image[0];
    $ext = pathinfo($image, PATHINFO_EXTENSION);
    
    if( $ext == 'gif' )
    {
    	$image = wp_get_attachment_image_src(get_field('image'), 'full');
    	$image = $image[0];
    }
    
    ?>
    <img src="<?php echo $image; ?>" alt="" />
    

    Hope that helps.

    Thanks
    E