Pagination not working for query_posts function (Querying pages)

I am trying to query all pages (not posts) on my front page with 20 posts per page with pagination.



$args = array(

    'post_type'  => 'page', 
    'posts_per_page' => 20,
    'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),


// The Query

query_posts( $args );    

// The Loop

while ( have_posts() ) : the_post();


<article id="post-<?php the_ID() ?>" class="post-<?php the_ID() ?> col-md-6 col-sm-12 post type-post status-publish format-standard hentry category-uncategorized">

    <div class="entry-detail">

        <header class="entry-header">

            <center><h2 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> </center>      </header><!-- .entry-header -->



 ?><div class="navigation">
  <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
  <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>

// Reset Query



The URL is:

The “More” link does not work.

Is it possible to add the normal pagination style of WordPress where it shows like “1, 2, 3…9,10”?

Read more here: Pagination not working for query_posts function (Querying pages)

Leave a Reply

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