WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] query_posts echos a questionmark? (2 posts)

  1. vegetable_man
    Member
    Posted 1 year ago #

    Quick question...

    I'm doing a query_posts on a Page. Basically I'm looking to see if an item is for sale or not. If it is, it should show the product info. Everything is going well except, when it queries my posts, I'm seeing a question mark.

    <!-- Query the Posts -->?
    <?php query_posts(post_type=post); ?>

    <!-- The Loop -->
    <?php while (have_posts()) : the_post(); ?>

    <!-- Get the value of for_sale -->
    <?php $sale = get_field(for_sale); ?>

    <!-- If its for sale, show it! -->`
    <?php if ($sale == "Yes") : ?>

    <p><?php the_title(); ?></p>

    <?php endif; ?>

    <?php endwhile; ?>

    My output consists of:

    ?
    Red Shirt
    Blue Shirt
    Green Pants
    Brown Shoes

    Whats with the question mark? I'm pretty sure that it has something to do with query_posts, but Im not explicitly telling it to display anything except the_title();

    Any ideas?

  2. vegetable_man
    Member
    Posted 1 year ago #

    Buh.... nevermind. I have a rogue question mark hiding behind my comment.

    Resolved!

Topic Closed

This topic has been closed to new replies.

About this Topic