• Resolved danieln82

    (@danieln82)


    Hey,
    I activated the function “Previous/Next post links”
    now I want to change two settings.

    First I want that it links only to posts in the same category.

    The second point is that I want to add a third link to post(s) in the overall/higher/master category.

    would be so nice if you can help me with that problem.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hi Daniel,

    Thanks for using Chosen!

    A customization like this is outside the scope of support we can provide for the theme, but if you’re comfortable writing a bit of code and working with a child theme I can outline the steps for this sort of modification.

    Thread Starter danieln82

    (@danieln82)

    That Would be sooooo Great!!!
    Thanks a lot!

    • This reply was modified 6 years, 7 months ago by danieln82.
    Theme Author Ben Sibley

    (@bensibley)

    Sure thing!

    There is a file called “post-nav.php” in the “content” folder in Chosen (chosen/content/post-nav.php). That has all the previous/next link code in it.

    Rather than editing that file directly, create a Chosen child theme, add a “content” folder to the child theme, and then copy the post-nav.php file into the content folder in your child theme.

    You can click here to download a starter child theme for Chosen.

    At the top of the file, you’ll find the get_adjacent_post() function used to get each link. You can simply add true as a single parameter and this will change it to include only posts in the same category.

    As for the link to the general category page, you can use get_the_category() to get the post’s category and then pass that result into the get_category_link() function to return a link to the category archive.

    • This reply was modified 6 years, 7 months ago by Ben Sibley.
    • This reply was modified 6 years, 7 months ago by Ben Sibley.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘previus/next post link’ is closed to new replies.