複数の WP_query ループを含むホームページがあり、注目の投稿が特定のカテゴリ ループに同時に表示されないようにしたいと考えています。注目の投稿でなくなったときにのみ、カテゴリ ループに表示されるようにします。
ここに私の注目のループがあります:
<?php
$featuredPost = new WP_Query();
$featuredPost->query('showposts=1&category_name=featured');
while ($featuredPost->have_posts()) : $featuredPost->the_post();
stuff
<?php endwhile; ?>
ここに私のカテゴリループがあります:
<?php
$categoryPost = new WP_Query();
$categoryPost->query('showposts=3&category_name=news');
while ($categoryPost->have_posts()) : $categoryPost->the_post();
stuff
<?php endwhile; ?>
<br/>
<?php
$categoryPost = new WP_Query();
$categoryPost->query('showposts=3&category_name=sport');
while ($categoryPost->have_posts()) : $categoryPost->the_post();
stuff
<?php endwhile; ?>
<br/>
<?php
$categoryPost = new WP_Query();
$categoryPost->query('showposts=3&category_name=art');
while ($categoryPost->have_posts()) : $categoryPost->the_post();
stuff
<?php endwhile; ?>
どんな助けでも大歓迎です。