The first argument that get_previous_post
and get_next_post
is $in_same_cat
. WordPress is looking for post of the same type in the current posts category. If your custom post type doesn’t support the category
taxonomy, both functions are likely to return nothing for the previous and next post.
Try calling both functions without arguments for your custom post type.
<?php if( $prev_post = get_previous_post() ): ?>
<div class="nav-box previous">
<?php $prevthumbnail = get_the_post_thumbnail($prev_post->ID, 'tiny_thumb' );?>
<?php previous_post_link('%link',"$prevthumbnail <p>%title</p>", TRUE); ?>
</div>
<?php endif; ?>
<?php if( $next_post = get_next_post() ): ?>
<div class="nav-box next">
<?php $nextthumbnail = get_the_post_thumbnail($next_post->ID, 'tiny_thumb' ); } ?>
<?php next_post_link('%link',"$nextthumbnail <p>%title</p>", TRUE); ?>
</div>
<?php endif; ?>