Pagination on Custom List templates
-
Hello,
For several reasons I’m using custom templates for Event Manager.
On listing pages, the default is to output a list of events with this code:
echo EM_Events::output( $args );This has default pagination. But I need to list out my events in a foreach() loop like so:
$EM_Events = EM_Events::get( array('scope'=>'future', 'limit'=>10, 'pagination'=>1) );
foreach ( $EM_Events as $EM_Event ) :
However pagination doesn’t work at all. It seems like that pagination won’t work with a get. From the docs:
When using a function or shortcode that outputs items (e.g. [events_list] for events, [locations_list] for locations), if the number of items supercede the limit of items to show, setting this to 1 will show page links under the list.
So how are we supposed to use the power of the custom templates, but still have pagination kick in?
Thanks!
The topic ‘Pagination on Custom List templates’ is closed to new replies.