Site logo

[Resolved] Changing the output of nav-next & nav-previous

Home Forums Support [Resolved] Changing the output of nav-next & nav-previous

Home Forums Support Changing the output of nav-next & nav-previous

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1706123
    Oliver

    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.

    #1706282
    David
    Staff
    Customer Support

    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/

    #1706997
    Oliver

    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

    #1707010
    Leo
    Staff
    Customer Support

    Unfortunately that cannot be done easily and will require a custom solution.

    #1707125
    Oliver

    Thanks for the answer Leo.

    #1708483
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.