- This topic has 9 replies, 2 voices, and was last updated 4 years, 7 months ago by Leo.
-
AuthorPosts
-
August 13, 2019 at 1:12 pm #983373Heather
Hi,
I have my “blog” page set up as my posts page, so that it can show an archive of all the posts on the blog, however the pagination at the bottom, although it shows there are 18 pages, only loads the same page/posts regardless of number.
All that happens is the url goes from /blog to /blog/page/2, but all the posts are the same.Is there a reason for this/solution to this? If no, is there some custom php I can put in a hook to make a pagination of my own and put it at the bottom of the page?
I should note that the pagination at the bottom of the category archives page (posts page displaying all posts for a specific category) does work as it’s supposed to, showing new posts depending on what page you are on, from most recent to oldest.
The pagination also won’t let me click on other numbers or the previous/next once I go to a new page.
August 13, 2019 at 1:22 pm #983381Heather.
August 13, 2019 at 1:45 pm #983405LeoStaffCustomer SupportHi there,
Any chance you can link us to the site in question?
You can edit the original topic and use the private URL field.
Let me know 🙂
August 13, 2019 at 1:53 pm #983409HeatherUnfortunately I can’t link you because it is on a private dev server for a company
August 13, 2019 at 2:52 pm #983435LeoStaffCustomer SupportAny chance you can set up a staging server for this?
It’s basically impossible for us to tell what the issue is without seeing the issue live.
We haven’t had other reports on this either.
If not then maybe try disabling all plugins except GP premium to see if there are any conflicts?
August 14, 2019 at 7:21 am #983903HeatherUnfortunately not. I tried looking through some previous tickets and the most I found was possibly an issue with permalinks, and that did not work. I looked through some Javascript that I have that exists in a hook for it to work throughout the website, and there’s no conflicting pagination javascript either.
Do you have any suggestions/ideas why it would be working on the category archives and not the posts archives? Is there some JS or code I can add somewhere to try to make it work? Anything helps, sorry.
August 14, 2019 at 8:11 am #984083HeatherNevermind, I figured it out. I had a function put into functions.php to offset the first post in the archive:
function wpsites_exclude_latest_post( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( ‘offset’, ‘1’ );
}
}Seemed to have conflicted with it, once I commented it out everything is working fine. Do you know how I can have the most recent post removed from the archive page without this code? I have the most recent post as a custom header displayed at the top of the page as a hook, so I don’t need it also showing as a post in the archives.
August 14, 2019 at 8:38 am #984113LeoStaffCustomer SupportWhat if you try the code we used in Rumour here?
https://gpsites.co/rumour/?page_id=42See the Posts List section.
August 14, 2019 at 10:12 am #984197HeatherWorked great! Thanks Leo
August 14, 2019 at 10:37 am #984211LeoStaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.