I have a custom template which has a custom query. I am using this template to create a page (Not a front page) from wordpress. Since the page has multiple posts, I want to put a navigation..... I did look at the multiple forums and posts which explains the problem with naviagations links not showing but in all the cases. Bot the next and previous links are not showing whereas in my case only the next_posts_link is Not showing while previous_posts_link is working fine.
printing the page number from paged works fine and browsing also works fine, but the links are not displayed as expected.
Here is my code and query
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
echo 'paged ' . $paged;
$args = array(
'post_type' => CUSTOM_POST_TYPE,
'posts_per_page' => 5,
'paged' => $paged,
'no_found_rows' => true,
'suppress_filters' => false,
'meta_key' => 'type',
'meta_value' => 'something',
);
$printposts = new WP_Query( $args );
<div class="nav-previous "><?php previous_posts_link( ' Newer posts' ); ?></div>
<div class="nav-next "><?php next_posts_link( 'Older posts »' ); ?></div>