• I have a library of past newsletters. There are 257 of these newsletters. The main page for that library correctly shows the first 10 items (default) and has a “Next Page” link at the bottom, ostensibly to take you the next 10. However… clicking it, nothing happens. However, if I click the “2” (or any other number), I get another page with all 257 newsletters, (not the group of 10 expected).

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @mike65535,

    Are you using the jQuery datatables library or a WordPress table plugin by any chance? I am seeing an error occurring on your website on clicking ‘Next Page’. Screenshot attached for reference.

    This does not seem like a WordPress Core issue. If possible, please test after disabling all plugins.

    Moderator bcworkz

    (@bcworkz)

    As Kaavya suspects, you’re using some sort of “load more” script. This could be part of your theme or implemented via plugin, but it’s certainly not core WP. For whatever reason, the script is failing to limit its query to the next 10 posts. I recommend asking for help through the dedicated support channel of the theme or plugin responsible for this script.

    Thread Starter mike65535

    (@mike65535)

    Thanks for the info. The site was set up by someone else and I’m trying to manage it. Armed with the suspicion of a plugin I looked some more and learned it is apparently TablePress. The TablePress site suggests I come back here to WordPress for support (since I’m not a premium user) so here I still am. The paging worked a few months ago so maybe an update broke it.

    So.. any TablePress aficionados?

    Otherwise I’ll try to reinstall or a even attempt a different plugin.

    Hi @mike65535,

    As this forum is dedicated to WordPress Core only, I would suggest that you post this question in the TablePress Support Forum. Other users/volunteers may be able to help you.

    Good luck!

    Moderator bcworkz

    (@bcworkz)

    I don’t know TablePress, but assuming the script is getting the next page’s worth of posts through an Ajax request that in some way ends up using WP_Query class to get the desired posts, the query could possibly be patched up through the “pre_get_posts” action hook. That’s a lot of assuming though, YMMV.

    The request will need to be passing the desired page number or this cannot possibly work. Var dump out the request’s $_REQUEST array to see how the page number is passed. If you can learn how the value is passed, set the “paged” query var with it (if it’s not already correctly set). Also set “posts_per_page” query var to 10 or whatever the correct count should be.

    These changes must only be done for the related request. All sorts of queries use this same action hook and you do not want to modify the wrong queries. Usually there’s some unique combination of query vars you could use to verify this is the right query to alter. If the newsletters are a custom post type, that’ll be a good thing to check.

    It’d be a lot better if the TablePress script could be corrected. The above solution isn’t ideal, but it’s a possibility if you have trouble getting the script corrected. Even if the query returns the correct newsletters, it’s still possible that the TablePress script will somehow mishandle the data. But at least the correct newsletters are being returned.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘library has “next page” results’ is closed to new replies.