Bug wtih previous and next post selector in context

Continuing the discussion from Display condition - Has Prev./Next Post (or next/prev post != current post):

Did a test with standard posts too, to ensure I did not make a mistake with my CPT settings.

In all cases (CPTs and Standard Posts) only 3 posts are navigated, there seems to be a bug with “next Post” and “prev post” selector with the context feature

Version: just updated to todays release

@FZwo, this is working for us with 4+ standard posts with the latest Cwicly version.

Perhaps there is something specific about your setup that is causing it?

Probably, and I am not able to sort that out, I am bit lost with that issue

Did you check it using a fragement to place that navigation into the posts as in my case?

No, so far in all of our cases we are using it directly in the post template as we have different styles of navigation for different post types.

Perhaps do a quick test in your template by copying the code from your fragment. Then depending on whether it has the same or different result will immediately rule out or point to it being in a fragment as the determining factor.

Did that (inserting the template part which includes the navigation and has been positioned via a fragment on the posts, now in a template to be used by my CPTs, and did the same with ordinary posts), issue still there

I even have tested it now by inserting the block containing the designed navigation directly into each ordinary posts, behavior remains the same

here we go what I have build (only up to the left navigation, the right is the same just mirrored):

Does this happen with all post types or just some in particular?

Perhaps there is a clue to which particular posts are the ones it navigates to and which ones it ignores.

Are they the first and last posts? Are there any other discernible differences (e.g. publish status, taxonomy terms, author, etc)

Also, will be good to establish what order to they navigate relative to the expected order.

it is, that always the same 2 posts are not addressed in the navigation, if it where the cpts (5 in total) or my test case with ordinary 5 posts. Strange is, there is no difference in any of their attrbitutes, double checked that several times. (and the ordinary 5 posts are just quick copies, with empty content).

If one opens a posts of the 2 that are not navigated, then they show inconsistent value of the navigation.

Regarding the order: I have no clue what order I can expect in using prev. post, next post, how can hat be managed (don’t see any possible settings for that)?

solved, incredible to sort that out: I had to toggle on the “same taxonomy term” despite I did not define any taxonomy, and secondly, take out the second context assignment to the paragraph, and they inherit the at the div wrapper already assigned context, and now dynamic text is put right too.

@Louis Probably there should be an update in your documentation.

The only question for me left is: what is the criteria by which “next post” and “pre post” navigation/ sorting? And, is there any way to customize that?

This definitely helps, you only need a single dynamic context in the wrapper div, absolutely.

If you toggle this off and retest with your new code, what exact behaviour do you observe?

It seems unusual that would make such a difference in your case unless there is some other unknown factor.

Back to the issue that posts are missing within the navigation. To be precise, I toggled it off at the link:

Yes, this is unusual, if it was just the default post type, the only thing I could think of is whether “Uncategorised” is selected for some posts and not others, but you have already indicated this happens on both custom types and the default type and there are no differences in terms, so aside from that, I can’t think of a good reason for it not to work.

Perhaps @Louis has an idea what might cause this?

Hi @FZwo,

Sorry to hear you’re having trouble with this.

Please understand that context means that all your blocks inside the contexted Div block now have the prev/next block as a reference (post title, post id etc…).

If you set a link to Prev. Post inside a previous context, you’re essentially going back 2 posts for the link. Setting it to Post URL will do the necessary as it is already inheriting the new context of the previous block.

1 Like

@StrangeTech, thanks for helping out here.

Moving to General as @FZwo has marked this post as a solution.


The cause was right there in the image, well spotted @Louis.

Sometimes all it takes is a fresh perspective to see what is right in front of us.

1 Like