Home › Forums › Calendar Products › Events Calendar PRO › tribe_get_events() parameters not affecting query
- This topic has 0 replies, 2 voices, and was last updated 6 years ago by thecolumbian.
-
AuthorPosts
-
March 28, 2018 at 4:10 pm #1491181thecolumbianParticipant
I am trying to query for events using tribe_get_events() but it doesn’t appear to be working properly. For example, this simple example is returning events, but ignoring the start and end date put in entrirely:
tribe_get_events( array( 'start_date' => '2015-06-01 00:00', 'end_date' => '2015-06-30 23:59' ));
It seems like the only parameter I can get to accurately work is the ‘posts_per_page’ parameter. Any ideas?
March 29, 2018 at 8:53 am #1491766thecolumbianParticipantAnother example (and there are plenty) – when I try to specify a category, it returns nothing:
tribe_get_events( array( 'posts_per_page' => 1, 'tax_query' => array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => 'business', ), ), ) );
If it helps at all, this function is hooked in from a custom plugin to the “tribe_plugins_loaded” hook.
- This reply was modified 6 years ago by thecolumbian. Reason: spelled "category" wrong
- This reply was modified 6 years ago by thecolumbian. Reason: extra hook detail
March 30, 2018 at 1:16 pm #1493139VictorKeymasterHi Brandon!
Thanks for reaching out to us! Let me help you with this topic.
First, please allow me to note that we are fairly limited in how much support we can give for custom development questions like that.
That said, we always like helping out and at least point users into the right direction as much possible.
The problem could be where the tribe_get_events() function is being called in. You could try placing your custom code inside your theme functions.php file and see if any difference.
Let me point you to our Extensions repository where you’ll find an extension template you can use as reference > https://github.com/moderntribe/products-extensions
Hope that helps. Let me know if any other questions.
Best,
Victor.April 21, 2018 at 9:35 am #1512917Support DroidKeymasterHey 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 ‘tribe_get_events() parameters not affecting query’ is closed to new replies.