0
我在製作wp_pagenavi作品時遇到了一些問題。 我有一個自定義的帖子歸檔頁面,我在其中激活了該功能。下面的代碼:Pagenavi和存檔頁面
<?php
// WP_Query arguments
$args = array(
'post_type' => array('connazionali'),
'nopaging' => false,
'paged' => '1',
);
// The Query
$query = new WP_Query($args);
// The Loop
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
the_title();
the_content();
}
wp_pagenavi(array('query' => $query));
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
分頁顯示正常,但是當我點擊第二頁上,都顯示相同的三篇文章(即使該網址/網頁/ 2是正確的)。 我只在歸檔頁面上注意到這個問題,而在類別頁面上它工作正常。
何我能解決問題嗎?
謝謝!
你好,感謝你的回覆。不幸的是,它不工作...任何其他的想法? – Stefano