Pagination For Looper Provider Plus

Hi,

I am currently investigating the most effective strategies for implementing pagination with ACF looper providers. I came across other threads available in the Forum on the subject, including Twig Example: Pagination for Looper Providers (finally!).

This solution is effective as long as Meta Values are not utilized to filter Looper items. Othervise, there are still a few challenges I am facing.

  1. I have two sections in the events calendar with Coming Events (green headline) and Past Events (grey headline). Their Looper Providers vary only by Meta Values, which I use to compare the current date with the event’s start and/or end dates and Order by settins. Since there are fewer upcoming events compared to the past events looper, I need pagination only for the last.
    It seams like using the Offset Code from the thread mentioned above counts all events in the looper, ignoring the Meta Values I set. The {{ looper.count }} key in the past events header works correctly and outputs the fact number of filtered looper items per page taking into account Meta Values used in the Query Builder. The Pagination Element displays 4 pages instead of the required 3 for national events, including some looper items that should be excluded by Meta Values. How to get rid of those looper items which should be ignored inside Pagination?

  2. The main Events Page shows all upcoming events, but the pagination is more confusing (much more buttons than should be) and returns a 404 error.

  3. Clicking any pagination button in the Coming Events section should switch to the next page and scroll down to the Past Events section using its ID in my case. Is there a way to add #ID to the pagination element URL so it would be added at its very end? If not, what could be a workaround? Should I make custom pagination buttons to get that option instead of using the native CS Post Pagination Element?

Pagination looks good for the 2025 taxonomy only because all events listed there in the past, with no separation between upcoming and past events.

Hey @referee,

Yes, the Offset Code ignores the Meta Values. What you need requires custom development which is beyond the scope of our product support. We’d be happy to check custom code possibilities under our One service.

Thank you @christian,

This project is for a non-profit organization, so they cannot afford custom coding. I also can not pay for One Service right now but I hope to get it in future if I have profitable projects. CS Forms LTD is the top priority for me at the moment so I need to invest into it first.

Maybe some of these comments could be considered by your Dev Team as feature requests for the future. That would be nice to have that build-in into CS someday.

Hey John,

I could add this as a feature request or maybe documentation request. Thank you for your feedback.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.