The Events Calendar
[resolved] Disable AJAX Pagination (8 posts)

  1. coreymcollins
    Posted 2 years ago #

    Is there any way to disable AJAX pagination? We're using The Events Calendar in conjunction with BuddyPress and only certain user levels/user roles will be able to see events in specific categories.

    For instance, everyone can view events in the Public category, but only Admins should see events in the Admin category.

    This works fine in general while using pre_get_posts to exclude those categories based on the user; however, with the AJAX pagination, we're not affecting the posts pulled in through the AJAX action.

    If I page to page 2 and am logged out, I will see an Admin event. If I refresh the page, the event will not be displayed.

    I think the best way to go about this is going to be to disable AJAX pagination and just use standard pagination. Is this possible at all?


  2. Barry
    Plugin Author

    Posted 2 years ago #

    I'm sorry coreymccollins - but we just don't have bandwidth to help with customization/integration requests like this one here on the free support forum. We really need to leave it to you as the developer to figure out things like this.

    Good luck!

  3. coreymcollins
    Posted 2 years ago #

    I don't think it would anything TOO crazy to allow for removal of AJAX pagination.

    I did it by replacing the links in the nav.php files (and saving those into my theme). I used the standard WP prev/next page links rather than the Tribe links. Maybe just a setting in the plugin itself to uncheck to disable AJAX pagination, then use the standard WP pagination?

    For ease of explanation, here is the standard pagination in views/list/nav.php:

    And the file replaced in my theme:

  4. Barry
    Plugin Author

    Posted 2 years ago #

    It's not crazy by any means :-) ... just not something we can assist with here. If you would like to put that forward as a feature request we'll happily consider it - please do post to:


    And thank you for sharing the solution!

  5. Mark Root-Wiley
    Posted 1 year ago #

    Thanks for posting those links, @coreymcollins. It's a big bummer that this is [still] what's required to use pre_get_posts.

    For whatever reason, your file wasn't working for me and I found the filter bar was also messing up views, so I posted a gist of the files that got it working for me: https://gist.github.com/mrwweb/db2f2808bfd751528df3

    I tweaked the navigation link strings too, but that's of course optional.

  6. leahkoerper
    Modern Tribe Support Rep
    Plugin Author

    Posted 1 year ago #

    Thanks for posting your gist MRWweb! Glad you found something that works for you :)


  7. Mark Root-Wiley
    Posted 1 year ago #

    FYI @leahkoerper and others. At least in my intial testing the 3.8 changes to /upcoming & /past seemed to break all the work I just finished :( Still not sure why.

  8. Brook
    Modern Tribe Support Rep
    Plugin Author

    Posted 1 year ago #

    For anyone interested MRWweb and I continued this discussion in his other thread: https://wordpress.org/support/topic/bug-ajax-views-ignore-pre_get_posts?replies=2


    - Brook

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic