Previous And Next Post Anomaly

So I thought this was a my theme issue and spent a good few hours banging my head against the keyboard and shouting at the screen - neither worked.

The problem (checked against my themes, ClassicPress default & TwentySeventeen): When I click on a mid list post, after reading I expect to see either a link or button to navigate to the next or previous - but no, I get a previous post pointing to the first post i.e Hello World and on that post I get a Next post which is back to the refering post :thinking:

Confused I thought no, this is not a theme issue and with no plugins active I had a guess it must be a Core issue. And it is but…not just ClassicPress, I encountered the same issue with WP (both the latest versions, nightly release on CP) :face_with_raised_eyebrow:

Now that you’ve read this far let me ask you…have you encountered the same issue and are your keyboard(s) and screen(s) free from harm?

To the Devs, is this a known core issue or are themes doing_it_wrong()?

It sounds like you have some code somewhere setting the posts order, and it’s not doing what you want. Check for something running on the pre_get_posts hook or use that hook yourself to set your preferred order.

Will dig around to see what gives.

The thing is I’m having the same issue with the Twenty TwentyFive on WP 6.8.1 :face_with_raised_eyebrow:

Could it be the localhost enviroment? I’m using Local Desktop app.

OK, so taken the themes to a live site and everything works fine. Now to figure out why Local is having a hissy fit on me :upside_down_face:

Appologies for the false alarm - just wanted to make a little noise as it seemed a little quet here today :grin:

Yes, it’s not a theme issue. You have something else going on there. You could try resetting permalinks to see if that solves the problem.

maybe try to disable all plugins that might interfere with the post retrieval, and then check them one by one = activate them one after another, to see which one is the potential culprit.

cu, w0lf.

@fwolf here they state they had no plugin active…

Edited to add: @editedcode Are you using Local by Flywheel or XAMPP or LAMP as a local environment? Either case if on a live site online it works and on a local environment it doesn’t I think the issue lies there. If you are using Local by Flywheel you can try to reach out to them. I am unaware if XAMPP has a support forum however - as for LAMP it shouldn’t be different from using a live site I think.

2 Likes

On that note, I’m using XAMPP for local development and never ran into this kind of issue before, so my guess @editedcode is using something else.

They mentioned “local” (that is why I was asking if it was Localy by Flywheel) - and this as you say could mean a lot of things.

If my guess is correct and it’s Local by Flywheel they need to contact them and ask what is different from a normal LAMP stack because there might lie the issue.

@ElisabettaCarrara I’m using Local by Flywheel and it seems the issue lies there - Works fine on Docker spun ClassicPress env.

Will reach out to Flywheel tomorrow and report the issue.

1 Like

Local by Flywheel is a good local environment, but I never used it because they have some “strange limitations” to what one can do (because it is supposed to build throwaway staging sites - proof of concept - and more design-wise than development-wise oriented).

This means I can’t really give advice on what might be the issue, but surely their support team will know where to look to solve it. Keep us posted, because I think that the solution to this might be of some use also for other users that do use Local by Flywheel. (and do mention to them that CP is very stable and growing and that we appreciate them supporting it)

1 Like