Archived topic
Changing the output of nav-next & nav-previous
5 replies · Started by Oliver on March 23, 2021
Hey guys, is it possible to make the nav-next & nav-previous links show the next and previous post within the same category of the article?, or make nav-next & nav-previous avoid showing one category (namely my blog posts category)?
My website uses normal blog posts (not woocommerce) to showcase products. Buyers are then sent to Amazon to make the purchase.
I would like visitors who are already interested in the products, to be shown other products and not be shown random blog posts.
Hi there,
You can add this PHP Snippet to your site:
add_filter( 'generate_category_post_navigation', '__return_true' );
Adding PHP: https://docs.generatepress.com/article/adding-php/
Great David! that worked, thanks a lot…
If it is not too complicated, how would I go about making the post navigation inside the product categories show random posts from all the product categories combined (categories 1 to 5 out of six (the slugs being: mystery, thrillers, science-fiction, fantasy, historical-fiction), and making the post navigation inside the sixth category which is the blog posts category, show the next and previous posts from said category
Unfortunately that cannot be done easily and will require a custom solution.
Thanks for the answer Leo.
No problem :)