This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Bricks Builder filtering compatibility issues

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Bricks Builder filtering compatibility issues Reply To: Bricks Builder filtering compatibility issues

#46389
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

I guess there is a custom script image lazy loader feature enabled on the results widget somewhere.

Either way, I found a possible event listener, which should trigger the “loading” of the images as it signals that the ajax search is complete and bricks will start loading the images afterwards:

add_action('wp_footer', 'asp_custom_footer_script', 99999);
function asp_custom_footer_script() {
	?>
	<script>
	document.addEventListener("DOMContentLoaded", (event) => {
		document.querySelectorAll(".asp_main_container").forEach(function(el){
		  el.addEventListener("asp_search_end", function(event) { 
			document.dispatchEvent(new Event("bricks/ajax/load_page/completed"));
		  });
		});
	});
	</script>
	<?php
}

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.

I have opened an issue on the tracker to make sure this is patched for the upcoming release, as it is a very simple solution.