• Does anyone know how to limit the next and previous post navigation links on individual posts (single.php) to posts within the category or sub-category?

    My website is ecis.ie. I’d like people to be able to navigate through ‘news & events’ posts and ‘blog’ posts separately but the post navigation mixes them all up at present.

    I’m using a child theme for twenty fifteen. I think this is the relevant code from the single.php file:

    // Previous/next post navigation.
    			the_post_navigation( array(
    				'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentyfifteen' ) . '</span> ' .
    					'<span class="screen-reader-text">' . __( 'Next post:', 'twentyfifteen' ) . '</span> ' .
    					'<span class="post-title">%title</span>',
    				'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentyfifteen') . '</span> ' .
    					'<span class="screen-reader-text">' . __( 'Previous post:', 'twentyfifteen' ) . '</span> ' .
    					'<span class="post-title">%title</span>',
    			) );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post navigation within category’ is closed to new replies.