我使用此多个循环来显示某些服装的销售情况,因此如果有销售(meta\\u值=是),则txt或演示文稿必须在顶部显示一次,其他产品在底部显示一次,如果有(meta\\u值=非),则用户会看到类似这样的消息:无销售可用。
在这个循环中,唯一的问题是演示文稿,它在顶部显示了很多次,所以请我如何让它显示一次?
谢谢
<?php query_posts(\'post_type=wear&meta_key=sold&meta_value=yes\'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<p>I\'d like this presentation to be showing one time if there is the sold</p>
<?php endwhile; ?>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<h1>Yes, there is some sold</h1>
<?php endwhile; ?>
<?php else : ?>
<h1>No sold available</h1>
<?php endif; ?>