Ah, you have coded the grid yourself, and used Masonry?
This post from Ross shows how to (generally) re-trigger Masonry after our Ajax call:
https://support.searchandfilter.com/forums/topic/reload-masonry-grid-after-ajax-call/#post-165867
AnonymousInactive
Hi Trevor,
Thanks ever so much for your quick reply as always :).
[section redacted by @trevorsf]
Ah so your code I think is for use with the Post Grid plugin, but we don’t use that, we use our own Masonry integration, which as I say if we use paging, the code we add seems to re-fire it, but it’s just when we use Infinite Scroll, you will see what it does once logged in as Admin and hopefully you can let me know what we need to do 🙂
$('.grid-masonry').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true
});
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
$('.grid-masonry').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true
});
});
Thank you again,
Tonya
Hi. I am having a problem, in that the link you give is re-directing to the home page?
When I edit that insights page in the admin editor, it is empty?
Did you add this script to the page (with the ID changed to your Post Grid ID):
(function ( $ ) {
"use strict";
/* Replace the ID <code>123456</code> with the ID of your grid */
var my_grid_id = '#post-grid-123456'; //alternatively use <code>.post-grid</code> for a less targeted approach
var $my_grid = {};
var $grid_items = {};
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
$my_grid = $(my_grid_id);
$grid_items = $my_grid.find('.grid-items');
if($grid_items.length>0){
if($grid_items.hasClass("masonry")){
$grid_items.removeClass("masonry");
$grid_items.masonry('destroy');
}
$grid_items.removeAttr('style');
$grid_items.masonry({isFitWidth: true});
}
});
}(jQuery));
If on its own and inline, it needs to be in script tags.
AnonymousInactive
Hello there,
Please could I get your help with something, I basically have Infinite Scroll with Masonry.
My code is:
$('.grid-masonry').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true
});
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
$('.grid-masonry').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-sizer',
percentPosition: true
});
});
And if I use usual pagination, all works fine, but when I use infinite scroll the second set of results load on top of the first set.
I also set the Infinite Scroll all accordingly with the post result selector and container settings.
I have done a search in Google and saw some suggestions but wasn’t sure they were exactly my case, so thought best to check with you :).
Many thanks,
TJ
That sounds like a problem with either lazyload or Masonry (Isotope).
Are you able to send me a live link/URL to your search page so I can take a look?
Avada has changed much since that thread you posted in and the solution there may no longer work. For a grid layout using Masonry, you need to follow these instructions:
https://searchandfilter.com/documentation/3rd-party/post-grid/
AnonymousInactive
@trevorsf split this post from https://support.searchandfilter.com/forums/topic/results-displayed-in-grid-format-for-avada-2/
Wondering how you implemented this:
actually ended up using the short code method and the Custom Post Types for Fusion Builder plugin. I was able to utilize the built in grid, masonry and carousel functions true to Avada along with the Infinite Scroll and Load More functions from Avada. Unfortunately, using the S&F Pro Ajax was still a no go when performing a new search, but I can live without it at this point.
Custom Post Types for Fusion Builder:
https://codecanyon.net/item/custom-post-types-and-taxonomies-for-fusion-builder/15572585
How I utilized it with Search and Filter Pro:
https://whsnew.pairsite.com/physicians-finder/
https://whsnew.pairsite.com/locations-practices/
I’m using the same Theme and method, just need to get the search on the archive page and updating the search. Where did you place the code for the search on the results page? Thanks.
I think I can see an error in the form setup. The Ajax Container looks wrong. At present it is not setup for Post Grid correctly, it should be:
#post-grid-3384
Using your theme’s own masonry grid requires that you know how to re-trigger that Masonry when an Ajax search is done (as each theme codes it differently, we cannot make any generic code to do that). We do have a code snippet to prepare to trigger that Masonry code, but it is missing that critical code.
AnonymousInactive
Hi Trevor,
Yesterday you helped me with the setting on the Elementor posts widget. Today I tried to set a widget myself. I set all settings the same as you did, but I always get a grey space between my photo and the text, when the widget loads the results from the search.
You can view it here. Masonry is out in the Elementor widget.
https://drive.google.com/file/d/1IF75G0U8H88hNWHb02gOoYeoUTkA1KfZ/view
Thanks for the help,
David
AnonymousInactive
I’ve been going around in circles all afternoon trying to get this to work, but I think it’s time to stop and ask that we all get together and get some comprehensive, easy to understand documentation together for this integration.
I’m quite competent with PHP, CSS, HTML, AJAX, XML, JS, page builders, etc. so we can get technical. However I’ve also been through what I believe is every post, documentation, etc. on both the Beaver Builder/Themer site and here and have yet to see appreciable results.
This site has some what appear to be good tutorials, but they didn’t work for me.
https://wpbeaches.com/add-search-filter-pro-to-beaver-builder-masonry-grid/
I’m willing to do whatever it takes to get this working and get a solid tutorial up, whether it’s on your site, Beaver Builder site or somewhere else. I see you have info on Elementor – time to do the same for Beaver Builder/Themer.
Ideally I want a single search page (/search) with the S&FP search form/filter at the top and the results as a Posts module (and the ability to use Masonry, List, or any other layout) below it, with Ajax filtering.
I’m also in contact with Beaver Builder to enlist their assistance.