Filter “Posts” widget in Post Archive section as AND/OR

This topic has 4 replies, 3 voices, and was last updated 4 weeks, 1 days ago ago by Jack Richardson

  • Avatar: carlyliczyk
    carliczyk
    Participant
    August 19, 2024 at 22:21

    Hello!

    I am using the “Posts” widget in the posts archive section, but it appears that the query is only selecting each category as “Category 1” OR “Category 2”. I wish to filter it as “Category 1” AND “Category 2”.

    Thanks for your help.

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    August 20, 2024 at 09:41

    Hello Carlyliczyk,

    Thank you for reaching out to us.

    Could you please provide the URL of the page and some screenshots related to your inquiry? This will help us assist you more effectively.

    Best Regards,
    8Theme’s Team

    Avatar: carlyliczyk
    carliczyk
    Participant
    August 21, 2024 at 22:16

    Hello, URL and screenshots provided.

    In the screenshot, its picking up a post in the “Featured Article” but the post is not in “Knowledge and Insights” so its using the OR filter, not the AND filter.

    Thanks

    Please contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 22, 2024 at 08:45

    Dear @carlyliczyk,

    We hope this message finds you well. We noticed that you have a similar request concerning the Posts Grid widget, akin to a previous inquiry we received about the Products Grid widget. You can review the discussion here for more context: https://www.8theme.com/topic/product-query-type-product-grid-widget-elementor-xstore/.

    We are pleased to inform you that we will be incorporating filters in our next update v.9.3.18 (https://xstore.8theme.com/update-history/), which will allow you to modify the logical relations (‘AND’ or ‘OR’) within the Posts widgets’ taxonomy query. The filter will be named:
    etheme_product_grid_list_product_taxonomy_tax_query

    Post-update, you will need to add the following code snippet to your child-theme/functions.php file to implement the changes:

    add_filter('etheme_posts_post_taxonomy_tax_query', function($tax_query) {
        $tax_query['operator'] = 'AND';
        return $tax_query;
    });

    We trust this enhancement will meet your requirements and we look forward to your feedback once it is implemented.

    Best Regards,
    Jack Richardson
    The 8Theme Team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.