Is single post navigation possible with this plugin?

[ad_1]

Hi @elahwyhw23,

What you are describing should be possible with a custom snippet in WPCode.

You can try something like the code below (replace with your category ID) but be aware that if a post has 2 categories and one of them is blog it will still be excluded.

add_filter( 'get_next_post_excluded_terms', 'wpcode_custom_exclude_all_terms_but_blog' );
add_filter( 'get_previous_post_excluded_terms', 'wpcode_custom_exclude_all_terms_but_blog' );

function wpcode_custom_exclude_all_terms_but_blog( $term_ids ) {
	$excluded_terms = get_categories(
		array(
			'hide_empty' => false,
			'fields'     => 'ids',
			'exclude'    => array(
				1, // Replace with the id of the category you want to include.
			),
		)
	);

	if ( empty( $term_ids ) ) {
		$term_ids = array();
	}

	return array_merge( $term_ids, $excluded_terms );
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer