这就是解决方案,感谢@lai32290
我的目标是建立一个在clothes store (post_type=wear
), 如果有提升(meta_key=sold
), 如果是(meta_value=yes
) 循环将首先只显示一次演示文稿,然后发布all the articles 促销/销售服装。否则,如果没有售出(meta_value=no
), 短语将是:无售
<?php query_posts(\'post_type=wear&meta_key=sold&meta_value=yes\'); ?>
<?php if (have_posts()): ?>
<p>I\'d like this presentation to be showing one time if there is the sold</p>
<?php endif; ?>
<?php while (have_posts()) : the_post(); ?>
<h1>Yes, there is some sold</h1>
<?php endwhile; ?>
<?php else : ?>
<h1>No sold available</h1>
<?php endif; ?>