Home › Forums › Calendar Products › Events Calendar PRO › List Events that are in two categories with the relation AND
- This topic has 6 replies, 3 voices, and was last updated 7 years, 7 months ago by
aheidrich.
-
AuthorPosts
-
August 21, 2018 at 1:47 am #1601844
aheidrich
ParticipantI have a nested category structure for my Dance events.
age group
children
youth
Adults
dance style
Salsa
tango
ballet
Level
Beginner
AdvancedEach event is assigned to each of the three main categories.
I use [tribe_events_list categories=”youth, ballet”] but this will show all events that are in “youth” OR “ballet”. How can i list events that are in “youth” AND “ballet”?
The [tribe_events] shortcode can only filter for one category? Or is it possible to filter for two and more categories like categories=”youth, ballet”?
Many Thanks
AndreasAugust 22, 2018 at 12:02 pm #1603315Jaime Marchwinski
KeymasterHi Andreas,
Thanks so much for reaching out!
If you’d like both the “youth” and “ballet” categories to appear with [tribe_events_list], you will need to create a parent category that is for both of those categories.
And yes, the [tribe_events] shortcode can only filter one category.
You can read more about all of our shortcode options here:
https://theeventscalendar.com/knowledgebase/pro-widget-shortcodes/
https://theeventscalendar.com/knowledgebase/embedding-calendar-views-tribe_events-shortcode/
Let me know if you have any other questions on this topic!
Thanks,
Jaime
August 22, 2018 at 12:42 pm #1603355aheidrich
ParticipantSorry, there was a typo/formatting problem in my first Post
I have tree main Categories “age group”, “dance style” and “level” with subcategories
age group
children
youth
Adults
dance style
Salsa
tango
ballet
Level
Beginner
AdvancedI need a list of events that are in the subcategories “youth” and “ballet”. Is this possible with the [tribe_events_list} shortcode?
Or on which template/position must ic change the tax_query function and insert ‘operator’ => ‘AND’ ?
Greetings
AndreasAugust 22, 2018 at 12:47 pm #1603358aheidrich
Participantthe category structure
August 22, 2018 at 1:19 pm #1603394Mathew
ParticipantAndreas,
Here’s an article with a snippet that will change the Operand to AND. It’s a few years old, but it still works today.
Hope this helps.
August 22, 2018 at 3:02 pm #1603530aheidrich
ParticipantMathew,
Many Thanks.
but the snippet is for the “”relation”, i need a change for the operator.
Unfortunately, when I replace “relation” with “operator” in the snippet, it does not work.
I need something like this
$cat_query[] = array(
‘taxonomy’ => ‘tribe_events_cat’,
‘field’ => ‘slug’,
‘terms’ => array(“youth”, “ballet”),
‘operator’ => ‘AND’,
);August 23, 2018 at 5:23 am #1603851Jaime Marchwinski
KeymasterHi Andreas,
Sorry to hear that did not work for you!
If this functionality is a requirement for your intended project, I’d suggest that a third-party developer would be the best way to make this feature happen on a short timeline. ? We maintain a list of developers who work with our plugins on our Knowledgebase here:
https://theeventscalendar.com/knowledgebase/custom-development/
Let me know if you have any other questions on this topic!
Thanks,
Jaime
September 14, 2018 at 9:35 am #1622024Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘List Events that are in two categories with the relation AND’ is closed to new replies.
