[Resolved] Pagination Not Working

Home Forums Support Pagination Not Working

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #983373
    Heather

    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.

    #983381
    Heather

    .

    #983405
    Leo
    Staff
    Customer Support

    Hi 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 πŸ™‚

    #983409
    Heather

    Unfortunately I can’t link you because it is on a private dev server for a company

    #983435
    Leo
    Staff
    Customer Support

    Any 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?

    #983903
    Heather

    Unfortunately 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.

    #984083
    Heather

    Nevermind, 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.

    #984113
    Leo
    Staff
    Customer Support

    What if you try the code we used in Rumour here?
    https://gpsites.co/rumour/?page_id=42

    See the Posts List section.

    #984197
    Heather

    Worked great! Thanks Leo

    #984211
    Leo
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.