2 queries on archive / category template

Hello all,
As you can see i have a category template with two containers.
1-> with grid 3 columns
2-> with grid 4 columns

How to combine the two queries and the pagination to make it work?

I tried:
The first grid to make it my main query and to the second just to use the offset posts. Pagination set to main query. It was working on my 1st page, but pagination did not work.

Different combinations with merge query etc, that didn’t work.

Is any other way to have the same layout with one query?

Thanks

if the pagination is not ajax load more button ofcoruse it will not work :slight_smile:

the moment someone clicks the pagination pages and the page changes they go to the archive pages and they see the main default query results

if I was solving this issue I would make the pagination as load more button they can keep loading older news on same page easily

oooor if you really really want to show pagination with page numbers and forward them to the pagination pages like page/1 page/2 …etc

solution woudl be just hiding the 1 2 buttons and start showing the 3 4 5 6 7 8 …etc :slight_smile:

just select 1 and 2 depending on how many news you are showing count it and just display:none it :slight_smile:

Hey sinanisler,

Thank you!
I didn’t try infinite scroll. I tested and it works just fine!

Do you know if the ajax page load with infinite scroll affects google analytics?
As i scroll down, i don’t see the url to change /page2, page/3 etc

I mean you can setup but 2 queries on archive a bit risky for seo I think you want to keep your archives natively paginated for better seo like page/1 page/2 …etc

just native default pagination so people can browser the archives easier long term

analytics perspective doesnt matter its fine

1 Like