• I’m trying to change my recent post to sorted by modified time, using 'orderby' => 'modified',

    It works that the recent post list ordered by the last time I modified the post, but some posts come up twice, though the order isn’t exactly the same.
    Example:
    1
    2
    3
    4
    5
    6
    4
    3
    7
    8
    9
    4 and 3 come up twice not in order.

    How to fix this? Which part I did it wrong?
    I already deactivated all plugins.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter muchmuch11

    (@muchmuch11)

    More info about my problem
    1. On my example, 4 and 3 have duplicate, when I trash all other posts, those 2 don’t have duplicate.
    2. Duplicate always come up on different page.
    3. Currently on each page I have 8 posts, when I change it to 100, there’s no duplicate on this one, posts that appear double on page 1 and page 2 now don’t have duplicate anymore. I guess this is why case #1 don’t have duplicate either.

    Another info, but I’m not sure about this, the duplicate appears on posts that multiple quick edited, so all of them have exactly the same modified posts timestamp, so WordPress confused to order it by modified date and the post appear on multiple pages.

    I guess this is a bug, any hot fix on this? Thanks

    • This reply was modified 7 years, 4 months ago by muchmuch11.
    Moderator bcworkz

    (@bcworkz)

    I’m unable to reproduce your problem, even after doing multiple quick edits and ensuring the range of edits fall on a page break. Your theory about confusion over identical timestamps doesn’t quite hold up because mySQL should consistently sort results by table (and coincidentally ID) order after requested ordering has been performed. You can try adding a secondary order by parameter of ‘ID’ to ensure ordering will always be consistent. You will likely still observe the same problem. If you do not, problem solved!

    Probably not solved. Please determine a process in which anyone can replicate the problem so that it can be investigated. Before going through that process, try reverting your site to a default state by deactivating all plugins and switching to a twenty* theme. Add your code to the theme that orders by modified date and see if the problem recurs. If so, this is the best state to work up a way to replicate the problem.

    I think the problem will go away in that state. If so, begin restoring your original state incrementally, testing after each step. When the problem recurs, the last activated code is the culprit of your problem.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order By Modified Duplicate Results’ is closed to new replies.