WordPress.org

Ready to get started?Download WordPress

Forums

wp_query returning duplicates (10 posts)

  1. thelanj
    Member
    Posted 2 years ago #

    Going a little nuts over this one:

    About a month or so ago all instances of WP_QUERY on my site started malfunctioning. The query works, but always returns the exact same results for the first and last entry of the query.

    Whether I'm limiting the query to 3 posts or 100, and no matter what I sort by, the first and last results are a duplicate.

    This is running on a fairly complex site with lots of plugins, customizations, and Wishlist Member. It's a very live site so I'd like to avoid publically switching templates or turning off plugins to figure out whats up.

    Anyhone have any ideas for how I might troubleshoot this with as little interruption as possibly?

  2. deepbevel
    Member
    Posted 2 years ago #

  3. deepbevel
    Member
    Posted 2 years ago #

    Don't know if this pertains, but I had an odity where a function I added to change the posts order caused my queries to brake, showing wrong categories and tags. I had to add the posts order to each argument instead of using a global function.

  4. dandy-wp
    Member
    Posted 2 years ago #

    I am having the exact issue. My WP_query is returning 1st and last entries as same result. @thelanj any solution/suggestion?

    Best Regards.

  5. deepbevel
    Member
    Posted 2 years ago #

    If it's not a new function or a plugin or theme, If it continues to be an issue you might try query_posts or GET posts. It would be good to know if it's just happening with WP_Query.

  6. thelanj
    Member
    Posted 2 years ago #

    Hi, thanks everyone.

    Upon further research I found a thread on the wishlist member forums with postings from a bunch of other users having the same problem. So its a bug on their end.

    Thanks!

  7. dandy-wp
    Member
    Posted 2 years ago #

    but i am not even using WishList Member :| . I'll try with query_posts().

  8. thelanj
    Member
    Posted 2 years ago #

    despite my issue being plugin related, i can say it was just WP_QUERY causing the issue. reset post data and using query_posts was effective as a workaround

  9. dandy-wp
    Member
    Posted 2 years ago #

    just found that some other guy had installed wishlist member. So issue is indeed specific to WishList Member only.

  10. dandy-wp
    Member
    Posted 2 years ago #

    okay I found a weird workaround.

    a call to query_posts() before WP_query() solves the problem. :|

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags