您已设置offset
参数,sopaged
参数被忽略;)
抄本:
偏移(int)-要置换或传递的桩号。警告:设置偏移参数会覆盖/忽略页面
如果要忽略此查询中最近的帖子,可以通过两种方式实现。
1. Custom pagination.
$ppp = get_option(\'posts_per_page\'); // or any other method to get your posts_per_page
$paged = get_query_var( \'paged\' ) ? get_query_var( \'paged\' ) : 1;
$args = array(
\'offset\' => 1 + ( $paged * $ppp ),
\'cat\' => -22,
\'paged\'=>$paged
);
2. Ignore first post
$most_recent_post_id = ...; // get the ID of most recent post
$paged = get_query_var( \'paged\' ) ? get_query_var( \'paged\' ) : 1;
$args = array(
\'post__not_in\' => array($most_recent_post_id),
\'cat\' => -22,
\'paged\'=>$paged
);