I am trying to query all pages (not posts) on my front page with 20 posts per page with pagination.
Code:
<?php
$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>
</article>
<?php
endwhile;
?><div class="navigation">
<div class="alignleft"><?php previous_posts_link('« Previous') ?></div>
<div class="alignright"><?php next_posts_link('More »') ?></div>
</div>
<?php
// Reset Query
wp_reset_query();
?>
The URL is: http://www.theiogames.com/
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)