我有一个档案。包含以下代码的php页面:
<?php // Start your custom WP_query
$my_query = new WP_query();
$paged = (get_query_var(\'paged\')) ? get_query_var(\'paged\') : 1;
$args = array(\'posts_per_page\' ?> 1, \'paged\' => $paged, \'category_name\' => \'Casino Slots\');
// Assign predefined $args to your query
$my_query->query($args);
// Run your normal loop
if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
?>
Test
<?php endwhile;
else :
// do stuff for no results
endif;
wp_pagenavi();
// RESET THE QUERY
wp_reset_query();
?>
它可以很好地显示帖子,但分页从不显示?