wordpress - Getting "Newer Posts" and "Older Posts" links on a Specialized Page Template -


i using specialized page template display list of posts. using following code that:

<?php  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array(     'paged' => $paged ); $all_posts = get_posts($args);  ?>  <?php foreach ( $all_posts $post ) : setup_postdata( $post );  ?> /* loop */ <?php endforeach; ?> 

now want put "newer posts" , "older posts" links below it. next_posts_link() , previous_posts_link() prints nothing here. how can add these 2 links on page?

use below code

<?php next_posts_link( __( '&laquo; older posts' ) ); ?> <?php previous_posts_link( __( 'newer posts &raquo;' ) ); ?>