Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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 items

    You can see it here (for category industrie):
    https://snipboard.io/q91e4n.jpg

    Once I turn the load more option off (or pagination), it all shows fine:
    https://snipboard.io/6oVq7l.jpg

    However, 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,
    Marc

    #1307891

    Hey 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,
    Ismael

    #1307914

    Hi 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?

    #1308118

    Since 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.

    #1308230

    Hi,

    Great, I’m glad that you came up with an alternative solution, and thanks for the update. I’ll go ahead and close this thread for now then, please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Masonry filter and load more button conflict’ is closed to new replies.