Skip to content

Snippet: Next/Previous Links NOT From Same Category

// Example 1: Disable next/prev in same term for staff members
function my_next_prev_in_same_term( $bool ) {
	if ( is_singular( 'staff' ) ) {
		$bool = false;
	return $bool;
add_filter( 'wpex_next_prev_in_same_term', 'my_next_prev_in_same_term' );

// Example 2: Disable for ALL Posts
add_filter( 'wpex_next_prev_in_same_term', '__return_false' );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top