List Events that are in two categories with the relation AND

Home Forums Calendar Products Events Calendar PRO List Events that are in two categories with the relation AND

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1601844
    aheidrich
    Participant

    I have a nested category structure for my Dance events.

    age group
    children
    youth
    Adults
    dance style
    Salsa
    tango
    ballet
    Level
    Beginner
    Advanced

    Each 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
    Andreas

    #1603315

    Hi 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

    #1603355
    aheidrich
    Participant

    Sorry, 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
    Advanced

    I 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
    Andreas

    #1603358
    aheidrich
    Participant

    the category structure

    #1603394
    Mathew
    Participant

    Andreas,

    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.

    #1603530
    aheidrich
    Participant

    Mathew,

    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’,
    );

    #1603851

    Hi 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

    #1622024
    Support Droid
    Keymaster

    Hey 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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘List Events that are in two categories with the relation AND’ is closed to new replies.