• Resolved jesseisrad

    (@jesseisrad)


    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!

    https://wordpress.org/plugins/events-manager/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Can you explain a bit more about how you’re using the template, especially the bit about using a get variable?

    Is the limit part working?

    Thread Starter jesseisrad

    (@jesseisrad)

    Sure thing. 1) one the limit is working and if I omit it, the page just goes into an endless loop and never loads.

    2) Basically I need to heavily customize the format of the output, so I’m using get instead and looping through the results (with foreach). Then I can echo vars like say $EM_Event->event_id or whatever I need.

    Does that explain it?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    maybe you can try to look into events-manager/em-functions.php then function em_paginate() – this could give you better example

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Pagination on Custom List templates’ is closed to new replies.