Pagination not working on gallery page when using custom index.php

Hi

I was testing my site using a local version and I found that pagination doesn't work on my gallery.php page.

I have the page navigation printed with:

`if(hasPrevPage() || hasNextPage()) printPageListWithNav(gettext('Prev'), gettext('Next'));`

I have read the Theming Tutorial (specifically the section titled "Separation of the gallery and the index page") and I believe I have it setup correctly (gallery page renamed to gallery.php, custom index.php in my theme's root and I have set "Gallery index page link" in my theme options to "gallery.php").

However when I click the pagination button to go to the next page I get this error:

"404 Page not found. Zenphoto Error: the requested object was not found. Page: gallery/2"

This only seems to happen on my gallery page, pagination on my search and album pages works correctly.

If I activate either Effervescence+ or zpMobile (both of which use custom index pages) and then navigate to the gallery index pagination works as expected.

I'm probably missing something really obvious but I have no idea what I'm doing wrong so any help would be greatly appreciated.

Comments

  • acrylian Administrator, Developer
    A bit hard to answer without knowing your theme. If it works with official themes there is surely something wrong on your custom one. Link maybe?
  • I have setup the live site with 2 test albums and set the theme options so that only one is displayed per page. Here is the link to the gallery page:

    https://southsmuseumofpostcards.nz/page/gallery/

    You can also test the search by typing "Test" which will give results spread over multiple pages. This is working as intended so the problem is definitely just with the gallery index.
  • acrylian Administrator, Developer
    I only see one album on the gallery index and no pagination at all.
  • Sorry about that I forgot to click publish on the second test album but could still see it because I was logged in as admin.

    I have published it now so there should be 2 albums on the gallery page.
  • acrylian Administrator, Developer
    You probably have not setup the pageValidity check. Take a look at the Zenpage theme's `functions.php` how to do that.
  • Thank-you so much for helping me out with that, I found the validation function in the zenpage theme's functions.php file.

    I copied the function and `$_zp_page_check = 'my_checkPageValidity';` over to my theme's functions.php file and now pagination on my gallery page works perfectly.

    Thanks again for all of your help :D
  • acrylian Administrator, Developer
    Yeah, that's glad I could help. Probably could have thought about this earlier.

    Don't forget to submit your site to the showcase gallery when finished.
Sign In or Register to comment.