Jump to content



Recommended Posts

Hi all,

I have a gallery section on site, where I have shown year-wise images and this section utilizes pagination. when you click on page 2 you will be able to see all the images that were posted in 2021 and on page 3 you will be able to see the year 2020's images. and I want to display years in descending order(i.e.: 2022, 2021,2020,.....) instead of 1,2,3 on pagination.

Pleas find the below attached image to see the structure I've created for gallery section in a processwire:


and this is how I fetch data on my page :



and the below code is for pagination


And this is how my section looks like :


I'm not sure how to go about this so any direction would be helpful.


Link to comment
Share on other sites

Why did you create a new user account to ask the same question like 


This could be considered spam. You should better ask follow up questions in your first thread.

Did you read @millipedia's answer?

It pretty much explains how you would go about. For rendering your "pagination" links you can use something like this simplified sample code:

foreach ($mygallery as $gallery) {
    echo "<a href='{$mygallery->url}{$gallery->title}'>{$gallery->title}</a>";


  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...