1. Home
  2. Knowledge Base
  3. FAQ
  4. How to open images in a lightbox?

How to open images in a lightbox?

You can use the oum_location_bubble_image hook to manipulate the output of the location image. This allows you to add a lightbox feature, for example. I would recommend using the WP Featherlight plugin to get a lightbox effect on images. And with the following PHP script (add it to your theme’s functions.php) you can enable the lightbox effect for the location images.

PHP
add_filter('oum_location_bubble_image', function ( $image, $location ) {

    // extend or change image
    $image = '<a data-featherlight="image" href="' . $location['image'] . '">' . $image . '</a>';

    return $image;
}, 10, 2);
Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

EN