Getting Events by specific catagory

Home Forums Calendar Products Events Calendar PRO Getting Events by specific catagory

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #125177
    revolution
    Participant

    Hey, I’m trying to get a feed of events by a specific category but it doesn’t seem to be working correctly. This is the code I have now:

    $events_array = tribe_get_events(
    array(
    ‘eventDisplay’=>’upcoming’,
    ‘posts_per_page’=>3,
    ‘tax_query’=> array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘signature-event’
    )
    )
    )
    );

    I’m trying to get the events by the slug “signature-event”. My code used to work but it seems an update has broken it. Any help appreciated! Thanks

    #126121
    Brook
    Participant

    Howdy revolution,

    Your code looks awesome! However, I did some testing and it seems to be working fine for me. If I had to guess, there is likely something about the updated plugin that is perhaps conflicting with some other bit of code on your site, maybe the theme or another plugin? Have you had a chance to test in the default 2013 theme and only Tribe plugins environment to see if that code works proper? If not, are you 100% sure you have upcoming events with that category?

    – Brook

    #128109
    revolution
    Participant

    I noticed if I switch it from ‘eventDisplay’=>’upcoming’ to ‘all’ it works, but it’s also getting events that passed. Any other option but ‘all’ gets every event regardless of category

    #128112
    revolution
    Participant

    Nevermind I got it to work, I just had to remove that line altogether. That seems like a bug to me? Either way this is solved. Thanks

    #130258
    Brook
    Participant

    Howdy revolution,

    I do not believe that is a bug. Our documentation regarding that function is a bit out of date. I am hoping we can get it updated and improved here soon.

    It is strange that removing that line made it work for your however. For me it was working fine with the line included. Either way I am glad it is working now, and I will talk to my manager about prioritizing an update to our tribe_get_events documentation. Hopefully that will clarify things and avoid future confusion. Thanks for posting your resolution!

    – Brook

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Getting Events by specific catagory’ is closed to new replies.