Use the 4th parameter $excluded_terms
http://codex.wordpress.org/Function_Reference/next_post_link
<?php next_post_link( $format, $next, $in_same_term = true, $excluded_terms="402", $taxonomy = 'category' ); ?>
Same for the previous_post_link
http://codex.wordpress.org/Template_Tags/previous_post_link
$previous="<span class="meta-nav">Previous Post</span>";
$next="<span class="meta-nav">Next Post</span>";
<?php previous_post_link( $format, $previous, $in_same_term = true, $excluded_terms="402", $taxonomy = 'category' ); ?>
Or you could create a template tag like whats included in Twenty Fourteen
if ( ! function_exists( 'twentyfourteen_post_nav' ) ) :
/**
* Display navigation to next/previous post when applicable.
*
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_post_nav() {
// Don't print empty markup if there's nowhere to navigate.
$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {
return;
}
?>
<nav class="navigation post-navigation" role="navigation">
<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1>
<div class="nav-links">
<?php
if ( is_attachment() ) :
previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) );
else :
previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>', 'twentyfourteen' ) );
next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>', 'twentyfourteen' ) );
endif;
?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->
<?php
}
endif;