Trouble using the plugin

Forums › Forums › Search & Filter Pro › Trouble using the plugin

Viewing 2 posts – 11 through 12 (of 12 total)
  • Ross Moderator
    #180742
    This reply has been marked as private.
    Ross Moderator
    #181572

    I figured it out. The script needed to relayout masonry is:

    (function ( $ ) {
    	"use strict";
    	
    	//detects when the ajax request has finished and the content has been updated
    	// - add scripts that apply to your results here
    	$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    		elementorFrontend.init();
    		//so load your lightbox or JS scripts here again
    	});
    	
    }(jQuery));

    Also, in some circumstances, I noticed there were some pagination issues, these can be fixed by adding this to functions.php (replacing my-posts, with the slug of the page the posts widget is on):

    //fix pagination issues in elementor when using posts widget with S&F
    add_action('loop_start', 'elementor_post_widget_pagination_fix', 10);
    function elementor_post_widget_pagination_fix($query)
    {
    	if(is_page("my-posts")){
    		$sf_paged = 1;
    		if(isset($_GET['sf_paged'])){
    			$sf_paged = intval($_GET['sf_paged']);
    		}
    		set_query_var("paged", $sf_paged); //elementor uses get_query_var to get current page, so lets set it before its performeed
    	}
    	remove_action('loop_start', 'elementor_post_widget_pagination_fix', 10);
    }
    

    Thanks

Viewing 2 posts – 11 through 12 (of 12 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.