用于分页
<?php
$paged = ( get_query_var( \'page\' ) ) ? absint( get_query_var( \'page\' ) ) : 1;
$content_args=array(
\'post_type\' => \'post\',
\'orderby\' => \'meta_value_num\',
\'paged\' => $paged,
\'posts_per_page\' => \'5\',
);
$wp_query = new WP_Query($content_args);
while ($wp_query->have_posts()): $wp_query->the_post();?>
//content here
<?php endwhile;?>
分页
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
\'base\' => str_replace( $big, \'%#%\', esc_url( get_pagenum_link( $big ) )
),
\'format\' => \'?paged=%#%\',
\'current\' => max( 1, get_query_var(\'paged\') ),
\'total\' => $wp_query->max_num_pages
) );?>