There are two very straightforward ways to create previous and next post buttons in Cwicly and they work well.
- Set the button action link source to dynamic and choose Prev. Post or Next Post
Use the dynamic context as demonstrated on the Cwicly youtube channel
Using the standard Wordpress previous and next post buttons also works but is not as customisable. The one advantage it has is that it automatically hides the button when there is no post to navigate to.
Please allow us to do this with the Cwicly approaches, as this is important for usability.
I thought about testing the post id, but that doesn’t seem possible currently as whether you are inside or outside of a dynamic context, the post id we have available will be the same and there is no “Prev Post ID” dynamic source for example.
The only way I can currently think to do this as a workaround is with a custom function in the condition.
If there is already a straightforward built-in way to do this, please let me know and this request can be closed.
One possible implementation can be to make it consistent with the current Has Prev/Next Page conditions (e.g. "Has Prev. Post / Has Next Post) as shown here:
Thanks for the suggestion!
Indeed, this does seem like a miss on our side, so I’m sorry about the inconvenience.
We’ll try and get this out as soon as possible.
As a temporary hacky workaround, we are currently using (within the dynamic context):
This at least hides the blocks when there is no post to display for now.
Worked with dynamic context to do the navigation, and used the display condition above. But I got an issue that not all CPTs are being navigated (tried to sort that out a couple of hours)
Additonal Info: I placed the navigation with a fragment to each of the cpts, and if I got to the end of the navigation, the cpt nav looks like this, and that is the expected behavior:
If I am just directly open one of the cpts which are not occurring in the navigation, it looks like this:
remark: The post title listed below the arrow is listed via the dynamic value feature
The structure behind that navigation is:
Do you mean not all posts within a CPT are being navigated? Or that some CPTs templates navigation is not working? Or something else?
What exactly do you mean by “not occurring in the navigation”?
If you can you give a bit more specific information about which conditions are working and which ones are not, that may help isolate the cause.
exactly, this is what I meant
What I am wondering about, that defined CPTs are not reflected in dynamic source or conditions (so that one can say, not only “posts” generically", but more specific e.g. “citations”
If Cwicly is using the wordpress next / adjacent post methods internally, then it probably works such that, whatever post type the template is applied to is what is used in the query for the previous / next post.
So if you have a default post, it will only navigate through others of the default post type, if you have a custom type (e.g. Book) then it will only navigate through others of the Book type.
That’s perfect I think, just mentioned that to exclude that using CPT for that navigation is currently an issue. The ones that are missing in the navigation are all of the same kind of CPT