Home › Forums › Calendar Products › Filter Bar › Display events in x AND y categories, instead of x OR y
- This topic has 4 replies, 3 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
February 10, 2015 at 3:04 am #941240gonzalosanzaParticipant
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!February 10, 2015 at 11:51 pm #941548Gustavo BordoniKeymasterHi 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 eitherpre_get_posts
orposts_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.
February 11, 2015 at 3:48 am #941571gonzalosanzaParticipantThanks, 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.February 11, 2015 at 10:26 pm #941857Gustavo BordoniKeymasterHi 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,
July 7, 2015 at 6:31 am #983735Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Display events in x AND y categories, instead of x OR y’ is closed to new replies.