Title: query_posts returns posts twice
Last modified: August 22, 2016

---

# query_posts returns posts twice

 *  Resolved [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query_posts-returns-posts-twice/)
 * Hi Lester,
 * I’m having a strange issue using this code:
    query_posts($query_string.’&v_sortby
   =views&v_orderby=desc’);
 * The posts are returned twice, the “while (have_posts())” shows each post twice.
 * Is it a bug or am I missing something?
 * Thanks
 * [https://wordpress.org/plugins/wp-postviews/](https://wordpress.org/plugins/wp-postviews/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query_posts-returns-posts-twice/#post-5679155)
 * That query is slightly wrong. [https://wordpress.org/plugins/wp-postviews/faq/](https://wordpress.org/plugins/wp-postviews/faq/)(
   last Q)
 *  Thread Starter [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query_posts-returns-posts-twice/#post-5679178)
 * Thanks!
 * Can I put that in the string format, without using the array?
    I’m asking because
   I’m building the string in my script in a certain way.
 * Thanks!
 *  Plugin Author [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/query_posts-returns-posts-twice/#post-5679193)
 * I don’t think so, you have to use an array and it is recommended to use an array
   instead.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘query_posts returns posts twice’ is closed to new replies.

 * ![](https://ps.w.org/wp-postviews/assets/icon.svg?rev=978002)
 * [WP-PostViews](https://wordpress.org/plugins/wp-postviews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-postviews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-postviews/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-postviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-postviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-postviews/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/query_posts-returns-posts-twice/#post-5679193)
 * Status: resolved