Support

Account

Home Forums General Issues Image clickable Reply To: Image clickable

  • I don’t know anything about the popup in that theme, I’m assuming that you are supposed to link to a larger size image, so you’ll need to get both sizes. Your code should probably look something like this.

    
    $image = get_field('image');
    $small_size = 'cb-480-240'; // (thumbnail, medium, large, full or custom size)
    $large_size = 'full';
    
    if ($image) {
        $small_image = wp_get_attachment_image($image, $small_size);
        $large_image = wp_get_attachment_image_src($image, $large_size);
        ?>
            <a class=”cb-lightbox" href="<?php echo $large_image[0]; ?>
                <?php echo $small_image; ?>
            </a>
        <?php 
    }