这个问题被问了很多次,但我仍然无法解决。这是我的密码
<?php get_header(); ?>
<?php $paged = ( get_query_var(\'paged\') ) ? get_query_var(\'paged\') : 1;
$custom_args = array(
\'post_type\' => \'post\',
\'meta_key\' => \'views_daily\',
\'orderby\' => \'meta_value_num\',
\'order\' => \'DESC\',
\'posts_per_page\' => 15,
\'paged\' => $paged
);
$custom_query = new WP_Query( $custom_args ); ?>
<?php if ( $custom_query->have_posts() ) : ?>
<!-- the loop -->
<?php while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
<div class="col3">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="entry">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"></a>
<div id="morepage-list"><?php wp_link_pages(array(\'before\' => \'<p><strong>Pages:</strong> \', \'after\' => \'</p>\', \'next_or_number\' => \'number\')); ?></div>
<div class="postdata"></div></div></div></div>
<?php
$counter++;
if ($counter % 3 == 0) echo \'<div class="cboth"></div>\' ;
?>
<?php endwhile; ?>
<?php wp_pagenavi(); ?>
<?php else: ?>
<p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
<?php endif; ?>
<?php get_footer(); ?>
我尝试了一些在网上找到的建议,但没有任何帮助。它只显示了前15个结果。但我希望根据我的查询详细信息进行完全可能的分页。对不起,我的语言不好。
最合适的回答,由SO网友:Abdul Awal Uzzal 整理而成
你需要改变<?php wp_pagenavi(); ?>
以下内容:
<?php wp_pagenavi( array( \'query\' => $custom_query )); ?>