This is the solution, And thanks goes to @lai32290
My goal is to have a loop who will search in the clothes store (post_type=wear
), if there are a promotion (meta_key=sold
), if yes (meta_value=yes
) the loop will first show a presentation just one time, and then to post all the articles of Promotion/Sold clothes.
else, if there is no Sold (meta_value=no
), the phrase will be : No sold available
<?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; ?>