我正在使用WP\\u Query和offset参数进行自定义循环。问题是,只要我添加偏移量,它就会中断分页,无论页码如何,都会显示相同的链接。
<?php
$paged = ( get_query_var(\'paged\') ) ? get_query_var(\'paged\') : 1;
$query_args = array(
\'post_type\' => \'notice\',
\'posts_per_page\' => 6,
\'offset\' => 1,
\'paged\' => $paged
);
$the_query = new WP_Query( $query_args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h3>
<?php endwhile; ?>
<?php wp_pagenavi( array( \'query\' => $the_query ) ); ?>
<?php endif; ?>
我尝试了以下代码:https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
但将此代码添加到我的主题会中断任何相关查询。有什么想法可以让这一切顺利进行吗?