Display events in x AND y categories, instead of x OR y

Home Forums Calendar Products Filter Bar Display events in x AND y categories, instead of x OR y

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #941240
    gonzalosanza
    Participant

    Hello, im looking the way to show through the filter-bar plugin, the events which match in the categories selected, I mean, if I have selected category x and category y, I only want to display those events which are categorized in the x category and at the same time in the y category.
    Any idea about what files should I modify?
    I suppose that may be just to change an || and set an && Isn’t it? but, where?
    Thanks!

    #941548
    Gustavo Bordoni
    Keymaster

    Hi Gonzalo,

    Thanks for reaching out to us.

    So as we use the WP_Query, you can follow the directions there about the tax_query. Filter using either pre_get_posts or posts_where. Remember to check for the variable $query->is_tribe_event to avoid the changing the main WordPress query.

    I hope I was able to solve your issues, and my Best Regards.

    #941571
    gonzalosanza
    Participant

    Thanks, I will try with this, (Until now I was trying to modify some ajax code).
    But I’m still a bit lost, this is a direction about how to make the queries, right? but could you point me on the direction to the files where the queries are made? I mean, where is made the query which says ‘display the category x OR the category y’ I would like check it to get an idea about how to customize my own code later, and be able to implement what you said above in a proper way.
    Thank you.

    #941857
    Gustavo Bordoni
    Keymaster

    Hi Gonzalo,

    That’s what the WP_Query will do for you, instead of using a SQL like “display the category X OR cat Y” you will pass or modify some variables using the filters I’ve given you.

    You can checkout this article on how to some of these customizations on the WP_Query.

    My Best Regards,

    #983735
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Display events in x AND y categories, instead of x OR y’ is closed to new replies.