WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. coreymcollins
    Member
    Posted 1 year 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?

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

  2. Barry
    Member
    Plugin Author

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

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

  4. Barry
    Member
    Plugin Author

    Posted 1 year 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:

    http://tribe.uservoice.com

    And thank you for sharing the solution!

  5. MRWweb
    Member
    Posted 5 months 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 5 months ago #

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

    Best,
    Leah

  7. MRWweb
    Member
    Posted 5 months 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 4 months 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

    Cheers!

    - Brook

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic