I’m having an issue with pagination on a static posts page. Under Reading > Settings, “Posts page” is set to a static page. “Blog pages show at most” is set to 10 posts. The first ten posts show up fine, but then the pagination doesn’t work (returns a 404 for “Previous posts”-link).
I’ve searched for an answer to this question, it seems to be fairly common and it’s even mentioned in the WP Codex (http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters), but all the solutions involving modyfying the default query haven’t been working for me, e.g:
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
$args = array('post_type'=>'post','posts_per_page'=>10,'paged'=>$paged);
query_posts($args);
OR
function qm_blog_pagination( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$paged = (get_query_var('page')) ? get_query_var('page') : 1;
$query->set( 'paged', $paged );
}
}
add_action( 'pre_get_posts', 'qm_blog_pagination' );
Any help would be greatly appreciated.
Thank you,
Pim