Tagged: load more, masonry grid
Hey,
I added the “Load more” button below the masonry grid layout.
Instead of showing the missing portfolio entries, it just randomly picks 8 entries again
and displays duplicates. I can repeat this infinitely.
Sadly other forum posts didn’t help much and it seems like none of the plugins cause it.
This happens in the “Referenzen” masonry.
Thanks in advance.
Hey emilconsor,
Thank you for the inquiry.
Did you use the masonry query filter in the functions.php file? Please post the login details in the private field so that we can check the site further.
Best regards,
Ismael
Hi Ismael,
thanks for the response.
Yeah, the query filter is in the functions.php.
//exclude current portfolio entry
add_filter('avia_masonry_entries_query','avia_exclude_current_masonry_item',10, 2);
function avia_exclude_current_masonry_item($query, $params)
{
global $wp_query;
$postid = $wp_query->post->ID;
$query['post__not_in'] = array($postid);
return $query;
}
Nevermind,
the solution was pretty obvious.
I chose order random, this caused the infnite duplicates. I switched it to order by slug and know the masonry stops once
all entries are displayed.