filter events by "featured event"

Home Forums Calendar Products Events Calendar PRO filter events by "featured event"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #749973
    fbit
    Participant

    I’ve created a loop that gets events successfully.
    The array I pass in to WP_Query looks like this:

    $args = array(
    ‘post_type’ => ‘tribe_events’,
    ) ;

    So far so good…

    Now, I’ve added an Event Category called ‘featured’. I’d like my loop to just get “featured events”.

    I figure that Event Categories are custom taxonomies. So I tried this:

    $args = array(
    ‘post_type’ => ‘tribe_events’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘featured’
    )
    )
    ) ;

    Unfortunately, this query fails, and the loop returns no results.

    So, what do I need to pass in to the loop arguments in order to get back events filtered by an Event Categories ?

    Thanks

    #751038
    Brian
    Keymaster

    Hi I can help you out with this.

    Try replacing the tax_query array with this:

    'tribe_events_cat'=>'featured'

    Let me know if that works.

    #751839
    fbit
    Participant

    Hey Brian.
    That works great!

    Thank you.

    #752966
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need any other on something else please post a new ticket.

    By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://wordpress.org/support/view/plugin-reviews/the-events-calendar?filter=5

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘filter events by "featured event"’ is closed to new replies.