I am not seeing this issue, but can you try changing the Ajax Container from #main to .masonry in the form settings?
AnonymousInactive
At http://www.zettelwerk.com/zettelsuchergebnisse (without AJAX) the initial setting of a filter eg “Bescheinigung” triggers well and collects the results and displays them with masonry well.
After this initial selection, if you want to change let’s say to “Post” within the same category, the action get’s triggered, the page reloaded, but for some reason it stays with the old category “Bescheinigung”.
On of the possible reasons might be, that I followed the responsive approach discussed elsewere in this forum, where I defined the filters for the Search Form UI twice, displaying Radio select on all screens except mobile, where CSS is used to display:none and instead display:block the duplicate set of dropdown selects.
Resetting the complete form “Alle Filter zurücksetzen” works.
Hi Floriane
With ajax disabled, there is no code that could (*should) affect masonry.
What happens if you disable Search & Fitler, is masonry working?
Thanks
AnonymousInactive
Hi, I use Search&Filter pro + Post-grid pro.
I would like to active masonry on my postgrid, but it doesn’t work.
I read a lot of comments on this forum, so I disabled Ajax.
But masonry still doesn’t work.
Do you have any idea for a solution?
This is the list of active plugins :
Polylang
Custom Post Type UI
Custom Post Type Widgets
Duplicate Post
Éditeur de page (but I don’t use it)
Post Grid
Search & Filter Pro
Simple Custom Post Order
WP ACF-VC Bridge (but I don’t use it)
Thanks for your help
AnonymousInactive
Hi, I use Search&Filter pro + Post-grid pro.
I would like to active masonry on my postgrid, but it doesn’t work.
I read a lot of comments on this forum, so I disabled Ajax.
But masonry still doesn’t work.
Do you have any idea for a solution?
This is the list of active plugins :
Polylang
Custom Post Type UI
Custom Post Type Widgets
Duplicate Post
Éditeur de page (but I don’t use it)
Post Grid
Search & Filter Pro
Simple Custom Post Order
WP ACF-VC Bridge (but I don’t use it)
Thanks for your help
Hi Vagi, I guesss this is after you use ajax, and you want masonry effect?
Try the suggestions here:
https://searchandfilter.com/documentation/3rd-party/elementor/#masonry-ajax
Thanks
From that link I can see that it is Page Builder, yes.
The layout is unusual, it doesn’t look like a normal Page Builder element. It is using Isotope(Masonry), which should (usually) only be used for multi column layouts, which yours is not. If you have a means to switch that off, I would.
How did you link the form to the results, as I see that the form is set to custom mode?
If I had been doing this, I would have placed a text block just above the results with this shortcode in:
[searchandfilter id="2147" action="filter_next_query"]
AnonymousInactive
Hi Trevor,
Ahh thanks ever so much for this, so I adjusted the code and now added the reload bit, which in Ross’s example it says we might need it… and so I think we did hehe, sorry should have tried that before!!
So… this is now the code:
function loadMasonry(){
//$container will always be a new copy
var $container = $('.grid-masonry');
// running images loaded again after page load / ajax event
// $container.imagesLoaded(function () {
// INITIALIZE MASONRY
$container.masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-item',
percentPosition: true
});
// Masonry has been initialized, okay to call methods
// not sure if you will need this here but might be worth adding in
$container.masonry('reloadItems');
// });
}
//if you need to call on page load etc...
loadMasonry();
//then also call it after ajax event
$(document).on("sf:ajaxfinish", ".searchandfilter", function () {
console.log("ajax complete");
loadMasonry();
$('.link-scroll').bind('click',function(e){
var $anchor = $(this);
$('html, body').stop().animate({scrollTop: $($anchor.attr('href')).offset().top}, 1500,'easeInOutExpo');
e.preventDefault();
});
});
So, almost there, the only tiny thing I am seeing is as you scroll it initially puts the posts on top of the existing ones, then as you scroll corrects itself [section redacted by @trevorsf]
Do you any little adjustment I can make to stop that?
Then I think all is perfect, so thank you again for your brilliant support! Don’t know what we’d do without your plugin, we use it on all sites, best out there as far as we’re concerned :)!!
Many thanks,
Tonya
I think you need some more code, somewhere. I am sorry, but I am far from expert with Masonry. However, look at the CSS being applied after the scroll:
https://www.screencast.com/t/y7gYIQxseK
The 925px is being re-applied. It is there when the first set of results is shown, and is added again when you scroll. That means that there is no room for the posts.
See how the first set of posts has the position CSS added, but the subsequent posts, when loaded, do not?
AnonymousInactive
Hi Trevor,
Thank you for this, so yep I’m already re-calling Masonry after your Ajax call, which usually always works, as we’ve used this loads with your plugin, the only difference on this one is that we’re using Infinite Scroll vs. Paging, and I think that’s where, for some reason, it’s not quite happy. If I change it to paging it works fine, but can you see on Infinite Scroll it loads the items on top of each-other?
This is the code which I did update to be more exact to Ross’s example, but sadly still no luck as it was doing the same as what we already had before (and like I say which does re-trigger it fine on paging):
function loadMasonry(){
$('.grid-masonry').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-item',
percentPosition: true
});
}
loadMasonry();
$(document).on("sf:ajaxfinish", ".searchandfilter", function () {
console.log("ajax complete");
loadMasonry();
});
Hope that helps :).
Many thanks,
Tonya