Hi Cara, you can use this before the loop:
query_posts( array( 'post_type' => array( 'post', 'tribe_events' ) ) );
In this way, the events are listed together with your “normal” posts.
Thread Starter
Cara
(@caracarafrycom)
Is there anything special I should add to only grab three most recent upcoming events?
Hi Cara. Yes, you’d need to specify what # of these get pulled in. Perhaps this will help? http://codex.wordpress.org/Function_Reference/query_posts Let me know if not.
Hey Roberto, I’m getting a huge error when I try using query_posts. My thought was that since this is a custom post type, is there a way of calling a custom post type from within the loop? I’m going to try it, but would like to know from others, in case they’ve tried this.
Thread Starter
Cara
(@caracarafrycom)
I can add the events to my main loop but what I was really asking is if there is a way to pull the next three events on the calendar into the primary loop? If I enter all of the events for the school calendar at once, I don’t want all of those events in the main loop at once. I just want the next three upcoming events. Is there a way to do this?
@clara, maybe it can be useful to use a query like this:
$latest_post_query = "(SELECT * FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date LIMIT 2)
UNION ALL
(SELECT * FROM $wpdb->posts WHERE post_type = 'tribe_events' ORDER BY post_date LIMIT 3)";
$latest_posts = $wpdb->get_results($latest_post_query);
Look for more info here: