Hi @muranyia,
Thanks fro reaching out!
You can use native WordPress functions like get_posts setting post_type = tribe_events or you could check our functions docs to use The Events Calendar functions like tribe_get_events.
To search events you can do a WP_Query with s parameter set to the title and post_type set to ‘tribe_events’.
<?php $query = new WP_Query( 's=mykeyword&post_type=tribe_events' ); ?>
Hope that helps 🙂
Best,
Nico
Thanks Nico for the reply.
I went with get_results() as I need to use a foreach cycle anyway.
$querystr = "
SELECT $wpdb->posts.*
FROM $wpdb->posts, $wpdb->postmeta
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
AND $wpdb->postmeta.meta_key = '_EventStartDate'
AND $wpdb->postmeta.meta_value > NOW()
AND $wpdb->posts.post_title LIKE '%".$search."%'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'tribe_events'
ORDER BY $wpdb->postmeta.meta_value DESC
";
$child_posts = $wpdb->get_results($querystr, OBJECT_K);
As far as I can see tribe_get_events() doesn’t let me search.
Thanks again and All the Best,
András