i'm using the events calendar plugin and at some place i use the tribe_get_events() function to show the upcoming events. Point is, i need to create a pagination for those results.
The tribe_get_events function is using wordpress' get_posts() and accepts some parameters like posts_per_page. I've tried adding some pagination parameters as i would with a WP_Query() request but without any success yet.
Here goes the code:
<?php global $post;
$all_events = tribe_get_events(array( 'eventDisplay'=>'upcoming', 'posts_per_page'=> 3, ));
foreach($all_events as $post) {
setup_postdata($post); ?>
<?php the_title(); ?>
<?php } wp_pagenavi(); wp_reset_query(); ?>
The 'paged' => get_query_var('paged') does change anything. Am also using the WP-PageNavi plugin but if there's a way to get the navigation working here without it it'd be already fine.