I am looking to create a gallery the utilises a popup gallery such as lightbox or fancybox.
Does anyone have a simple solution for this, should I use a plugin or just install the script in my theme.
If anyone has any examples that would be great.
On a side note does anyone know if the gallery field can be used for videos?
Thanks

@johnw6761 I use a true/false field as enable/disable lightbox / fancybox field. This is no “simple solution” as in “plug-and-play” to implement. You need to register / enqueue the lightbox / fancybox css and js files yourself. Just wrap every image in your gallery loop with an element and the lightbox / fancybox options. If you want a plug-and-play solution, you’re gonna have to search for a plugin or add-on.
If you like to code, it could look something like this:
$output = '<figure' . get_the_attributes($attributes) . '>';
if(is_object($lightbox)) $output .= "<a data-fancybox=\"{$lightbox->id}\" href=\"{$lightbox->href}\" data-srcset=\"{$lightbox->srcset}\">";
if(!empty($options['before'])) $output .= $options['before'];
$output .= wp_get_attachment_image($image_id, $image_size, $is_icon, array('class' => $image_style));
if(!empty($options['after'])) $output .= $options['after'];
if(is_object($lightbox)) $output .= get_the_icon('search') . '</a>';
$output .= '</figure>';
Hope this helps.
Note “get_the_attributes” and “get_the_icon” are not default WP functions.