DUPLICATED: Strange behaviour with Post Category Filter (Checkbox) with offset

Browser: Chrome 126
OS: Windows 11
WP: 6.6.1
URL: on request

Hi! I’m trying to create a simple Post category filter with checkboxes (multiple selections). On my news page there is a featured post (the latest post) which got a different design and doesn’t need to be included in the filter. Right below the featured post there is the filter and below the filter there is a 3-col grid with the other news posts (separate query).




Screenshot 2024-08-12 130456

There are two issues with the filter I’m currently experiencing. First one is that the count isn’t correct. I got 12 dummy posts on the site, 11 in “Uncategorized” and 1 in “Test” (and only in “Test”) category. It seems like it’s adding the featured post to the filter count(?).
Second is whenever I click on the “Test” category checkbox filter, the filter gets disabled and all the posts disappear, leaving a blank page below the filter.



Tried in Incognito mode as well. What could be the issue here? Is there a problem with the filter when having 2 queries on the same page? As there is a query selector in the filter (which I chose correctly) I think there shouldn’t be one. If you need more information, just let me know. Any help is appreciated, thank you!

Hi @cza ,

Thanks for reporting the issue, this was reported before in WIP: Filters don't work on query loops with an offset

The count is not right when offset value exists in Query settings.

However, for your second question, if you are filtering “Test” category, the result is empty which is expected. This is because you are querying all posts where category is “Test” + offset 1, and your entire website only has 1 post with “Test” category, the offset 1 causing no result. Hope this explanation makes sense.

Regards,
Jenn