117 posts
    Has been part of the Envato Community for over 3 years Has sold $100+ on Envato Market Has collected 1+ items on Envato Market Sells items exclusively on Envato Market
+1 more
fAntasticmE says
'has_archive' => false
shouldnt this be true?
147 posts
    Has been part of the Envato Community for over 3 years Has referred 10+ members Has sold $250,000+ on Envato Market Has collected 10+ items on Envato Market
+2 more
FlexiPress says

Your question is not clear for me… Is it for your “post type” archive page or for single “post type” page page?

For archive page, archive-yourposttype.php, or your custom page template to show your custom post type, you have to use next_posts_link and previous_posts_link inside the loop.

References:
http://codex.wordpress.org/Function_Reference/next_posts_link
http://codex.wordpress.org/Function_Reference/previous_posts_link

For single post page, single-yourposttype.php, you have to use next_post_link and previous_post_link inside the loop.

References:
http://codex.wordpress.org/Function_Reference/next_post_link
http://codex.wordpress.org/Function_Reference/previous_post_link

Note: we use them on one of our theme and it works. ;)

2024 posts
    Elite Author: Sold more than $75,000 on Envato Market Has sold $250,000+ on Envato Market Sells items exclusively on Envato Market Contributed a free file of the month
+8 more
revaxarts says

Thanks to all who helped me but the solution is quite different!

I didn’t get the mentioned links because I changed the post status from ‘published’ to ‘finished’ and the get_adjacent_post() function in the link-template.php file generates a SQL statement with post_status = ‘publish’. Fortunately it provides a filter hook so this code solves my problem:

add_filter('get_previous_post_where', 'my_get_post_where');
add_filter('get_next_post_where', 'my_get_post_where');

function my_get_post_where($sql) {
    return str_replace("'publish'", "'finished'", $sql);
}

I think the register_post_status is not implemented well in the whole WP core

9 posts
    Has sold $100+ on Envato Market Has collected 1+ items on Envato Market Located in Dominican Republic Sells items exclusively on Envato Market
+1 more
oidoperfecto says

This is more simple and clean:

<div class="entry-post-nav group">
    <?php $prev_post = get_previous_post(); ?>

    <?php if ( !empty( $prev_post ) ) : ?>  
        <div class="post-prev">
            <a href="<?php echo get_permalink( $prev_post->ID ); ?>">? Prev Posts</a>
            <h4><a href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo $prev_post->post_title; ?></a></h4>
        </div>
    <?php endif; ?>

    <?php $next_post = get_next_post(); ?>

    <?php if ( !empty( $next_post ) ) : ?>  
        <div class="post-next">
            <a href="<?php echo get_permalink( $next_post->ID ); ?>">Next Posts ?</a>
            <h4><a href="<?php echo get_permalink( $next_post->ID ); ?>"><?php echo $next_post->post_title; ?></a></h4>
        </div>
    <?php endif; ?>
</div>
by
by
by
by
by
by