How to display the pagination in my post list?

<?php
$paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1;
$args = array( ‘posts_per_page’ => 6, ‘offset’=> 0, ‘category’ => 1, ‘paged’ => $paged );

$custom_query = new WP_Query( $args );
while($custom_query->have_posts()) :
$custom_query->the_post();
?>

My Html code

<?php endwhile; ?>
<?php
previous_posts_link(‘&laquo; Newer posts’);
next_posts_link( ‘Older posts &raquo;’, $the_query->max_num_pages );
wp_reset_postdata();
?>

What’s wrong?

Read more here:: How to display the pagination in my post list?

Leave a Reply

Your email address will not be published. Required fields are marked *