1
私は検索して検索していますが、私の問題は解決していません。私は解決策があるようだが、彼らは私の特定のコードのために働いていない。WordPress - カスタムループでページネーションが動作しない
私がしたいのは、最新の投稿を呼び出してメインの "特集記事"として機能する2つのループを持つことです。 2番目は、2番目に最近の投稿で、別のスタイルになっています。次に、2番目のページ、つまり「サブ投稿」の下に、ページネーションを行います。
問題は...ページネーションが機能しません。数字が表示されますが、クリックすると何も起こりません。助けていただければ幸いです!ここ
がコードされ...
<div id="featuredpost">
<?php $my_query = new WP_Query('posts_per_page=1&cat=4');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<span class="subposttitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><br>
<small>Posted in <?php the_category(', ') ?> on <?php the_time('l, F jS') ?>.</small>
<br><br>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<br>
<hr>
<br><br>
<?php endwhile; ?>
</div>
<div id="subposts">
<?php $my_query = new WP_Query('posts_per_page=1&offset=1&cat=4');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<span class="subposttitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></span><br>
<small>Posted in <?php the_category(', ') ?> on <?php the_time('l, F jS') ?>.</small>
<br><br>
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<br>
<hr>
<br>
<?php endwhile; ?>
<center>
<?php wp_pagenavi() ?>
</center>
</div>