Title: query_posts echos a questionmark?
Last modified: August 20, 2016

---

# query_posts echos a questionmark?

 *  Resolved [vegetable_man](https://wordpress.org/support/users/vegetable_man/)
 * (@vegetable_man)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/query_posts-echos-a-questionmark/)
 * 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 it`s 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
 * What`s with the question mark? I'm pretty sure that it has something to do with
   query_posts, but I`m not explicitly telling it to display anything except the_title();
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  Thread Starter [vegetable_man](https://wordpress.org/support/users/vegetable_man/)
 * (@vegetable_man)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/query_posts-echos-a-questionmark/#post-3206063)
 * Buh…. nevermind. I have a rogue question mark hiding behind my comment.
 * Resolved!

Viewing 1 replies (of 1 total)

The topic ‘query_posts echos a questionmark?’ is closed to new replies.

## Tags

 * [beginner](https://wordpress.org/support/topic-tag/beginner/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)
 * [question mark](https://wordpress.org/support/topic-tag/question-mark/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [vegetable_man](https://wordpress.org/support/users/vegetable_man/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/query_posts-echos-a-questionmark/#post-3206063)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
