Trigger responsive lightbox

<?php
 /** trigger the responsive lightbox plugin to reinit on facet update
 ** https://wordpress.org/plugins/responsive-lightbox/
 **/

add_action( 'wp_head', function() { ?>
<script>
(function($) {
    document.addEventListener('facetwp-loaded', function() {
        $(document).trigger( 'rlArgs.customEvents' );
     });
})(jQuery);
</script>
<?php }, 100 );