Site logo

Archived topic

post-nav stay in current category & loop

15 replies · Started by freeform1999 on January 31, 2018

Viewing posts 16–16 of 16

Hello,

Just to share that in order to show posts navigation of the same category has worked for me both Tom's post:

add_action( 'after_setup_theme', 'tu_category_specific_post_navigation' );
function tu_category_specific_post_navigation() {
    add_filter( 'generate_category_post_navigation', '__return_true' );
}

and this one from another website (I am not an affiliate):

add_filter( 'generate_post_navigation_args', function( $args ) {
    $args['in_same_term'] = true;
    return $args;
} );

https://www.gmitropapas.com/generatepress-tips-and-tricks/blog/limit-post-navigation-to-the-current-category/

PS: I come from Joomla, and sometimes I love Wordpress, and other times (as in this case) I am surprised that Wordpress itself does not have an option for something as basic as this in a CMS.

This archived topic is closed to new replies.