Single custom post type pagination same custom taxonomy

<?php $prev_post = get_adjacent_post( true, '', true, 'taxonomy_slug' ); ?>
 <?php if ( is_a( $prev_post, 'WP_Post' ) ) { ?>
 	<a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo get_the_title( $prev_post->ID ); ?></a>
 <?php } ?>

<?php $next_post = get_adjacent_post( true, '', false, 'taxonomy_slug' ); ?>
 <?php if ( is_a( $next_post, 'WP_Post' ) ) {  ?>
 	<a href="<?php echo get_permalink( $next_post->ID ); ?>"><?php echo get_the_title( $next_post->ID ); ?></a>
 <?php } ?>