• Hi,
    I’m trying to add a line of code to my page to keep the previous and next buttons, below my single portfolio item page within the same categorie. Right now, when you press the next butting within the last item of the categorie, de user is sent to the next categorie.

    I found some previous topics, but I can’t figure out how to get it done. I found a template-tags.php file within the theme I am using where I find the following code:

    <div class="nav-previous"><?php previous_post_link( '%link', '<div class="nav-previous-title">'.__( "VORIG PROJECT", "shopkeeper" ).'</div> <span> %title </span>' ); ?></div>

    I think I have to use the $in_same_cat = true function, but when I change the code into this:

    <div class="nav-previous"><?php previous_post_link( '%link', '<div class="nav-previous-title">'.__( "VORIG PROJECT", "shopkeeper" ).'</div> <span> %title </span>', $in_same_cat = true ); ?></div>

    It doesn’t work, the previous button disappears.

    I am using the theme shopkeeper, and WordPress version 4.3. URL: http://www.bbve.nl, single post on portfolio page.

    Could anyone please help, I’ve been trying to solve this sinds I can’t remember when.

  • The topic ‘Next item in same cat – not working’ is closed to new replies.