How can we loop the previous and next post block’s functionality so instead of getting to the lat post and ending, it loops back to the first post?
Or if this is not possible, can we at least display either control when it disappears at the first or last post as an inactive UI element? I’ve tried with CSS but nothing’s working (so far), but maybe I’ve not done this completely right. I’ll paste the code I’ve tried for this fall back solution but any information or ideas appreciated, thank you!
/* Show the previous post navigation link at all times */
.wp-block-post-navigation__prev-link {
display: block !important;
}
/* Adjust the styling of the inactive previous post navigation link */
.wp-block-post-navigation__prev-link.inactive {
opacity: 0.5;
/* Additional styling properties here */
}
/* Show the previous post navigation link at all times */
.post-navigation-link-previous {
display: block !important;
}
/* Adjust the styling of the inactive previous post navigation link */
.post-navigation-link-previous.inactive {
opacity: 0.5;
/* Additional styling properties here */
}
]]>I have my posts grouped into 3 basic categories: Blog, Recipes, and Photo Galleries. I want the next/previous post links at the bottom of each post to only direct visitors to posts within the same category. You can see a good example of this at: https://test.garnergrows.com/baked-kale-chips/. The Next post link goes to another recipe, but the Previous post goes to a Blog entry which is less than desirable!
I have setup a staging copy of my site as well as a child theme for Dyad 2 so that I can safely edit php files, but I am unsure exactly where and how to edit. I (believe) I have found the code for these links in the “single.php” file. Other answers to the question have indicated that: ‘in_same_term’ must be set to “true”, but I am unsure exactly how and where to do this.
Any help would be appreciated. Thanks!
]]>My Posts are in different languages and each language has its own Category. Next to each Post in WordPress, in the column on the right, I indicate in the Post Settings the Category (language) of the Post.
In Barnsbury, below each Post, automatically it links to the Previous and Next Post
However, this link does not take the category into account so the Previous or Next Post Is usually in another language
Based on information I found on the internet, I eventually tried to add this code to the functions.php file (similar code seems to work with another Theme)
– – – – –
function barnsbury_post_navigation() {
the_post_navigation( array( 'in_same_term' => true, ) );
}
– – – – –
But that didn’t change anything. Does anybody know where/how to make Previous / Next Page stay within the same Category in the Barnsbury Theme?
Thanks a million,
Paul
]]>Very nice, simple plugin, that works – many thanks.
One issue I’ve found: ordinarily it seems to operate correctly on the Previous Post, Next Post Links when viewing posts, BUT, unlisted posts DO seem to appear as previous/next post links IFF one is already viewing an unlisted post!
ie: if several unlisted posts are next to each other in the timeline, then they will each appear as previous/next links. Far from desirable.
Any chance this could be fixed?
Many thanks
]]>I would like to ask how this plugin works?
Because I use this plugin, it reorders my post very well.
But I use another plugin to add after my posts a “Next/Previous” button. But if I hit this button, it doesn’t open the correct REORDERED post. It opens the DEFAULT ORDERED post, not the reordered.
Can I fix it somehow?
]]>How to remove Previous Post and Next Post option ?
]]>Thanks for any help.
]]>