0
<?php 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
    'posts_per_page' => 10,
    'paged' => $paged,
);
query_posts($args);?>

I used this code in WP page template, then published a page with this template, then set this page as static homepage, then I find paged always equals 1. when I click page 2, I still get same content as page 1, although url is correct ,such as /page/2/

1 Answers1

1

i find the answer myself. just use

get_query_var('page')

instead,it will work.