• I’m not sure if I am posting in this correct place but I am trying to get my previous and next posts work from the same category. Is it possible? I tried a couple of things during my search but they didn’t work.
    Thanks for any help given.
    https://www.getalifemedia.com/mobile

    In case you may need to know, I am using Twenty Fourteen template

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi. What have you tried? WP should automatically do this for you when you are viewing a certain category (also known as an archive page). If there just no links showing up or are they showing up but just not doing what you want them to do?

    Thread Starter crystalm36

    (@crystalm36)

    You’re right, it does do the previous and next. But I have posts that are in categories and I would like to do is have the next and previous to open up the next post in that category alone not in another category. Does that make sense?

    Thread Starter crystalm36

    (@crystalm36)

    Found the answer!!! YAY!
    Here: https://adopttheweb.com/2016/03/24/change-twenty-fourteen-next-previous-post-text/

    In case the site goes down this is what I done. Added this piece of code to the functions.php

    // Change Previous / Next Text
    
    if( ! function_exists(twentyfourteen_post_nav) ) { function twentyfourteen_post_nav() { 
    
    	echo '<nav class="navigation post-navigation" role="navigation">
    			<div class="nav-links">';
    							previous_post_link( '%link', __( '<span class="meta-nav">Previous</span>%title', 'twentyfourteen' ), true );
    							next_post_link( '%link', __( '<span class="meta-nav">Next</span>%title', 'twentyfourteen' ), true );
    	echo '</div><!-- .nav-links -->
    		</nav><!-- .navigation -->';
    }}

    Great news and good luck!

    emilysparkle

    (@emilysparkle)

    thanks for this topic and answer. it almost works for me. can the next button disappear when there are no more posts in the category rather than just continuing on to the next represented category?

    Justin Greer

    (@justingreerbbi)

    Hi @emilysparkle,

    The solution should not be showing any link if there is none.

    Please start a new support topic. You can reference this topic in your post but it just keeps things cleaner and easier to follow for both users and moderators.

    Thanks ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Previous & next in same category’ is closed to new replies.