I have about 20-30 posts in a CPT, and when I click on a single post and use the next_post_link and prev_post_link functions it will only show a select 5 posts out of the 20-30... always the same 5 as well.. I can\'t for the life of me work out why!
I\'ve tried limiting to taxonomies or categories but that just brings it down to 0 links.
Has anyone come across this?
EDIT: I\'m using a very streamlined install... the only plugins are CPT UI for the Custom Post Type and ACF for the fields.
Here is my code for the single-books.php (Single CPT page) the url is site.com/books/book-name
<?php get_header(); ?>
<main role="main">
<section>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="col3">
<h1 class="title"><span><?php the_title(); ?></span></h1>
</div>
<div class="col3">
<div class="cover">
<?php $cover = wp_get_attachment_image_src( get_field(\'cover_image\'), \'book\' ); ?>
<img src="<?php echo $cover[0]; ?>" alt="">
</div>
</div>
<div class="col3">
</div>
<div class="clear"></div>
<div class="col3">
<span class="label">Author:</span>
<span class="data"><?php the_field(\'author\') ?></span>
<span class="label">Publisher:</span>
<span class="data"><?php the_field(\'publisher\') ?></span>
<span class="share">[ Share ]</span>
</div>
<div class="col3">
<span class="label">Review</span>
<span class="data"><?php the_content(); ?></span>
</div>
<div class="col3">
<span class="label">Publication Date:</span>
<span class="data"><?php the_field(\'publication_date\') ?></span>
<span class="label">Genre:</span>
<span class="data"><?php echo get_the_term_list( $post->ID, \'genres\', \'\', \', \', \'\' ) ?></span>
<span class="label">Reviewer:</span>
<span class="data"><?php echo get_the_term_list( $post->ID, \'staff\', \'\', \', \', \'\' ) ?></span>
<?php if (get_field(\'buy_link\')) : ?><span class="buy"><a target="_blank" href="<?php the_field(\'buy_link\') ?>">· Buy Now ·</a></span><?php endif; ?>
</div>
<div class="clear"></div>
<div class="col3 align-right pagination">
<?php previous_post_link( \'%link\', \'« Previous Book\', FALSE ); ?>
</div>
<div class="col3">
<hr>
</div>
<div class="col3 align-left pagination">
<?php next_post_link( \'%link\', \'Next Book »\', FALSE ); ?>
</div>
<div class="clear"></div>
<div class="spacer"></div>
</article>
<?php endwhile; ?>
<?php endif; ?>
</section>
</main>