Gallery image light box [ click to image return image zoom in ] ( work only elementor plugin is installed )



/* Activity Gallery Shortcode*/
function activity_gallery( $atts )
{
ob_start();
$images = get_field('activity_photo_gallery');
$size = 'full'; // (thumbnail, medium, large, full or custom size)
if( $images ):
echo '<ul>';
foreach( $images as $image_id ):
$image_url = wp_get_attachment_image_src($image_id, $size);
echo '<li>';
echo '<a data-elementor-open-lightbox="yes" data-elementor-lightbox-slideshow="6b82d93" href="'.$image_url[0].'">';
echo wp_get_attachment_image( $image_id, $size );
echo '</a>';
echo '</li>';
endforeach;
echo '</ul>';
endif;
return ob_get_clean();
}

add_shortcode( 'activity_gallery', 'activity_gallery' );