• Resolved Dave

    (@dvaer)


        Hi,

        I’m using the Filter & Grids plugin to filter a custom post type called “Projects” based on taxonomy terms. However, the “Taxonomy Relation” setting does not seem to be working as expected when I set it to "AND".

        My site uses a custom post type called “Projects”, which behaves like posts.

        I have three projects, each assigned to different categories:

        • Project 1: social, special, transformation, care
        • Project 2: development, living
        • Project 3: development, complete

        On the frontend, I have set up filtering by project categories. I enabled "Multiple Taxonomies" and tested with Taxonomy Relation set to "OR", which works as expected.

        However, when I switch the Taxonomy Relation to "AND", the behavior remains exactly the same as "OR".

        Expected Behavior (when set to "AND"):

        • Selecting “development” and “living” should display only Project 2.
        • If I add “special”, no results should be shown (since no single project has all three terms).

        Actual Behavior:

        • Filtering by “development” and “living” still displays both Project 2 and Project 3 (same as “OR”).
        • Additional filters continue behaving as if “OR” is applied, even though “AND” is selected.

        Troubleshooting Steps Taken:

        1. Tested with the 2024 default theme to rule out theme conflicts.
        2. Disabled all other plugins to check for conflicts.
        3. Cleared all caches (browser, site, and server-side).
        4. Checked for JavaScript errors in the console (none found).
        5. Verified that my plugin settings correctly reflect “AND” in the backend.

        But the issue is still there. Is there a configuration step I may have missed?

        I’m using WordPress 6.7.2 and version 2.9.68 of the plugin.

        I hope you can help with this.

        Thank you in advance,

        Dave

      Viewing 5 replies - 1 through 5 (of 5 total)
      • Plugin Author YMC

        (@wssoffice21)

        Hi!

        We would like to explain to you a little the principle of filtering posts by the “Taxonomy Relation” option. This option says: How to select posts from the specified taxonomies. It can be:
        AND – posts that are simultaneously included in the specified taxonomy terms.
        OR – posts belonging to any of the specified taxonomy terms.
        Thus, it affects which taxonomies (more than one taxonomy) your posts will belong to. And since you only have one taxonomy, this parameter does not particularly affect the filtering results. Different terms are attached to your posts and, accordingly, the desired posts will be displayed depending on the selected term.
        We suspect that you have this list (social, special, transformation, careб development, livingб complete) as terms and not categories (taxonomies). This is one category with several terms and that’s all.
        In general, the plugin uses the logic of the global WP_Query object and all actions occur according to the algorithms of this object.

        Thread Starter Dave

        (@dvaer)

        Thank you very much, that explains it ??

        I have now done an advanced query with a callback function as per your documentation, which is very comprehensive by the way. This works.

        The only thing not working for me yet is showing all posts initially when the page loads, but that’s probably something I need to adjust in my custom query, and I should be able to figure that out.

        Many thanks!

        Plugin Author YMC

        (@wssoffice21)

        Good Luck!

        Thread Starter Dave

        (@dvaer)

        Thank you – I got it working the way I want, but I feel it’s a bit of a hack the way I did it. Would it be okay if I email you my callback function so you can have a quick look? I have a feeling there’s something I’m not getting, or perhaps something that you have a setting or filter for that I’m missing. If not, that’s also fine – it works this way – just curious ??

        Thank you ??

        Plugin Author YMC

        (@wssoffice21)

        Hi!

        We are glad that you managed to implement your idea) You can send us a file with your code and our specialists, if possible, will evaluate it.

        Good luck!

      Viewing 5 replies - 1 through 5 (of 5 total)
      • You must be logged in to reply to this topic.