Post Featured Images Missing When Filtering with AJAX
-
Hello, I am using a plugin called Search & Filter Pro to add custom filtering to a blog archive. I am also using WP Rocket LazyLoad. When LazyLoad is active, the featured images disappear after using the post filter. I reached out to the Search & Filter folks and they gave me an explanation and piece of code to fill in with the FadeIn code for LazyLoad.
Can you assist me in what code I would need from your plugin? Essentially, we need to make sure LazyLoad is called again after the AJAX filtering ends, so the images fade in to the page.
“The lazyload plugin doesn’t know to check again if images need to be loaded. You would need to contact the lazyload plugin author and ask for the fadein code (fadein is the function that jQuery lazyload uses, assuming that is what the plugin is using) needed to be added in the commented line below:”
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ // call your script or function here }); }(jQuery));</script>
Thanks!
- The topic ‘Post Featured Images Missing When Filtering with AJAX’ is closed to new replies.