WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Pagination on template files (12 posts)

  1. rontarson
    Member
    Posted 2 years ago #

    Anyone else having issue with pagination on template files? Specifically category-single.php

    The pagination shows on the bottom of my event list but when clicking on page 2,3,etc the link always re-loads page 1 and never goes on.

    <?php
    echo EM_Events::output( array(
    	'limit'=>20,
    	'scope'=>'future',
    	'category'=>$currentid,
    	'pagination'=>'1',
    	));
    ?>

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    are you using this on another page? I ask because the code you pasted there looks like you're making your own customization, might have a different effect.

  3. rontarson
    Member
    Posted 2 years ago #

    No just using it on category-single.php And if i take out everything else on the template page and just use

    <?php
    echo EM_Events::output( array(
    	'limit'=>20,
    	'scope'=>'future',
    	'category'=>1,
    	'pagination'=>1,
    	));
    ?>

    The pagination still doesn't work. It DOES work everywhere else in EM world on my site, just not on category-single. Confusing.

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    not sure why, would look into this in the coming weeks once v5 is out but maybe if you copy some of the code from events-list.php it should work. it might be that it's limited to shortcodes.

  5. debsch
    Member
    Posted 2 years ago #

    Ever solved this problem?
    I'm getting it too. Page 2, 3, 4 all go to page 1.
    And I'm using events-list.php

  6. debsch
    Member
    Posted 2 years ago #

    So instead of using

    echo EM_Events::output(array(
    'format'=>'<B>#_EVENTLINK</B><br/> and all my custom php stuff here',
    'limit'=>20,
    'pagination'=>1));

    I'm now using

    $args['format'] = "<B>#_EVENTLINK</B><br/> and all my custom php stuff here";
    $args['limit'] = 20;
    // NO PAGINATION ARGS - USE THE DEFAULT BECAUSE THE DEFAULT WORKS
    echo EM_Events::output( $args );

    and YAY pagination is working.

    FIXED! (for me anyway)

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    interesting... does this work for you rontarson?

  8. rontarson
    Member
    Posted 2 years ago #

    Sorry, just saw this post. Using debsch's solution above does NOT solve the pagination error I'm having on a custom format page, in my case single_location_format.php

    Without defining $args['pagination'] = true; the pagination wont show at all.

    The below will show pagination but the linking still is not functioning.

    $args['format'] = "<B>#_EVENTLINK</B><br/>";
    $args['limit'] = 5;
    $args['pagination'] = true;
    echo EM_Events::output( $args );

    debsch's solution may work on templates but does not seem to solve it on custom format pages

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I think this should work now, check out the dev version

  10. rontarson
    Member
    Posted 2 years ago #

    @Marcus- I have always used the full production versions of EM. Is there a link to the dev versions somewhere? Sorry if I'm just missing it.

  11. agelonwl
    Member
    Posted 2 years ago #

  12. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I'm testing this out, and I can't reproduce this on the latest dev version.

    I paste both of debsch codes e.g. into the page.php file of the BP default theme, and it works perfectly fine (even both on the same page), pagination and all.

    not sure what else to say.... if you're hooking into EM with filters, one thing you'll have to do is just output the array of $args down the line of functions to see where pagination gets unset.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic