到目前为止,这是我索引中的代码。php文件:
<?php
// Custom code to offset posts and setup pagination
$page = get_query_var( \'paged\' ) ? get_query_var( \'paged\' ) : 1;
$ppp = get_option( \'posts_per_page\' );
if ( $page == 1 )
$offset = 6;
else
$offset = 6 + ( $page - 1 ) * $ppp;
$args = array(
\'posts_per_page\' => $ppp,
\'offset\' => $offset,
);
$offset_query = new WP_Query ( $args );
?>
在这一点上,一切都很好,除了网站上有一个没有帖子的额外页面。显然,这是因为found\\u posts不考虑偏移量,所以found\\u posts认为有更多的帖子,并添加了额外的页面。那么,我如何从found\\u posts值中扣除偏移量,以便不出现额外的页面。或者,我如何摆脱显示的额外页面。