Tagged: filter, load more, masonry, pagination
-
AuthorPosts
-
June 28, 2021 at 2:22 pm #1307753
Hi,,
My client has a portfolio post type with about 180 caegorized items. We show them through a masonry grid, with filter option, and load more button (or pagination) at the bottom (since the maximum number of items to show is 100). When playing with the filters two things go wrong:
– Portfolio items are shown while they do not belong to the selected category
– The page is copped at the bottom, sliding through some itemsYou can see it here (for category industrie):
https://snipboard.io/q91e4n.jpgOnce I turn the load more option off (or pagination), it all shows fine:
https://snipboard.io/6oVq7l.jpgHowever, this way I can only show 100 items, while there are about 180.
Is there a way to set the max items to 200?
Or otherwise, can you guys please take a look at this?Cheers,
MarcJune 29, 2021 at 9:49 am #1307891Hey Marc,
Thank you for the inquiry.
We can use the avia_masonry_entries_query filter to adjust the query for the masonry element and increase the number of items or entries without having to adjust the element option or edit the files directly.
Example:
/** alter masonry query **/ function avia_masonry_entries_query_mod( $query ) { $query["posts_per_page"] = 200; return $query; } add_filter("avia_masonry_entries_query", "avia_masonry_entries_query_mod");
Please note that the filter above will affect every masonry element in the site, so adding conditional functions or logic to limit it to certain pages or a specific masonry element may be necessary.
Best regards,
IsmaelJune 29, 2021 at 11:52 am #1307914Hi Ismael, thnx for the reply mate! :-)
The number of items show nicely, right now; thought the problem would be solved. For the part of cropping the page/images, it does.
However, some portfolio items are still showing for categories where they should not…
For example: clicking the categories ‘industrie’, then ‘kantoren’, then ‘onderwijs’, and then back and forth, the upper 3 portfolio items are the same, while they should not. See: https://snipboard.io/LRgDn6.jpg
Turned off all plugins, cleared cache, and problem still resists.
In the private content a link with user id and password to the staging environment, as well as a login as admin to the staging site; can you please take a look and see whats going on?
June 30, 2021 at 1:09 pm #1308118Since I’ve decided to go with the portfolio grid instead of the masonry grid, and with some help I got the look & feel the same as the masonry grids (see: https://kriesi.at/support/topic/portfolio-grid-hover-like-masonry-grid-hover/), this topic can be considered as solved.
July 1, 2021 at 7:42 am #1308230 -
AuthorPosts
- The topic ‘Masonry filter and load more button conflict’ is closed to new replies.