WIP: Pagination not working with any query

Hello. I get this error in query loop pagination in the cpt I created with meta box: “This query type doesn’t support pagination”

Element structure and other details in the screenshots.

https:// prnt.sc/FSHqI7lT8KY_

Query: https:// paste.ee/p/Ltu6v

Since I am a new user, I can only add two links max. So I added the other two links as text

Notes:

  1. In Meta Box, has_archive support is active in cpt.

  2. I tried native post type of wordpress (post). Still same

  3. I’m using latest stable version (1.9.7.1) of Bricks with AdvancedThemer

  4. I tried turn off ajax features and Bricks beta features but no luck

Hi Onur,
Welcome to the forum, and thanks so much for your report!

Unfortunately, I can’t replicate the issue. If I paste the query code to the native Bricks query editor (and change the post type to my Meta Box CPT), the pagination works without issues. So there must be something wrong on your end, which I cannot see at first glance.

You’re using the “global query manager” feature from Advanced Themer, which is a third-party plugin/feature. Please get in touch with Advanced Themer support to get this sorted.

Alternatively, try using the native Bricks query editor and see if it works there.

Best regards,
timmse

Hey @timmse ,

This issue is related to the pagination element which doesn’t allow other queryTypes than “user”, “post”, “term”:

In order to create global queries in Advanced Themer, I’m using the following filter: Filter: bricks/setup/control_options – Bricks Academy which creates dynamic queryTypes:

Screenshot 2024-05-04 alle 09.06.00

It would be helpful if we could have a filter to add our own queryTypes allowed in the pagination element. Right now, none of the global queries will be compatible with the pagination element and there is not much I can do about it.

Cheers,
Maxime

3 Likes

Hey @maximebeguin ,

Thanks for the info.

Currently, we restricted the pagination element to only support ‘post’, ‘user’, & ‘term’ objectType because we added logic that can retrieve $current_page and $total_pages for these 3 native loops.

We can provide a total of 3 hooks to make use of the pagination element:

  1. pagination use custom logic - boolean ( default false, if true, will not check the query object type and not execute query, you can get the element settings from this hook to decide returning true or false )
  2. one filter for the pagination current page - integer ( you can get the element settings from this hook for your own logic)
  3. one filter for the pagination total pages - integer (you can get the element settings from this hook for your own logic)

Example (Not final)


Do you think this can address your problem?

Regards,
Jenn

1 Like

The global queries in AT basically follow the same logic as using the queryEditor. If the loops using the queryEditor support the pagination element, I would guess it should work with global queries as well without messing with $current_page and $total_pages. I will do further tests and let you know :+1:

1 Like

Hello!
I think this would be beautiful! Would be possible to get this filters, so we can include pagination for our custom loops :slight_smile:

Thank you!