Support » Theme: Lovecraft » Previous Next Post Links within category

  • Resolved mmckaibab

    (@mmckaibab)


    I’m wondering if there’s any way to limit the previous and next post links to posts within the current post’s category. I’ve found a plugin called “previous/next post link plus” but can’t figure out which file in the them I would put the code to achieve what I need.Thanks for any help.

Viewing 1 replies (of 1 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @mmckaibab,

    It’s not doable with plugins, but if you’re comfortable with coding, you can do it pretty easily by creating a Lovecraft child theme. All you need to do is to copy the singular.php file to the child theme and replace the following lines:

    $prev_post = get_previous_post();
    $next_post = get_next_post();

    With this:

    $prev_post = get_previous_post( true );
    $next_post = get_next_post( true );

    That will make the singular pagination point to the previous and next posts within the same category. You could also hire someone to do it for you.

    — Anders

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.