Support » Plugin: The Events Calendar » Disable AJAX Pagination

  • Resolved coreymcollins

    (@coreymcollins)


    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?

    https://wordpress.org/plugins/the-events-calendar/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Barry

    (@barryhughes-1)

    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!

    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:
    https://gist.github.com/coreymcollins/8862818

    And the file replaced in my theme:
    https://gist.github.com/coreymcollins/8862825

    Plugin Author Barry

    (@barryhughes-1)

    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:

    http://tribe.uservoice.com

    And thank you for sharing the solution!

    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.

    Plugin Contributor leahkoerper

    (@leahkoerper)

    Modern Tribe Support Rep

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

    Best,
    Leah

    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.

    Plugin Author Brook

    (@brook-tribe)

    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

    Cheers!

    – Brook

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable AJAX Pagination’ is closed to new replies.