Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search by custom post type › Reply To: Search by custom post type
September 6, 2023 at 1:05 pm
#45259
Keymaster
Hi Valentina,
It is because after filtering a hook is triggered to initialize the posts element. I guess that somehow interferes with the lightbox in some way. It is hard to tell if this is possible to solve, but some custom code may be needed.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_action('wp_footer', 'asp_add_footer_script', 99999);
function asp_add_footer_script() {
?>
<script>
window.addEventListener('load', () => {
WPD.Hooks.addFilter('asp/live_load/start', function(){
WPD.Hooks.removeFilter('asp/live_load/finished');
}, 10);
});
</script>
<?php
}
If all goes well, then this may do the trick.