• Resolved fzeidan

    (@fzeidan)


    Hello All,

    I am trying to sort by post by date, but I don’t care for last update (revision date). The code is:

    $the_query = new WP_Query('cat=-' .$catid. ',-' .$catid2. '&showposts=5&offset=1&orderby=post_date&order=desc');

    How can I modify that line to ignore revisions and only show the posts?

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

    (@fzeidan)

    You know… I debugged the code and looks like the resulting query is ignoring the resulting order by and is ordering by the ID. I ran the same resulting query in MYSQL and sure enough… results are ordered by ID even though it contains order by clause

    Thread Starter fzeidan

    (@fzeidan)

    Problem turned out to be in the MySQL. Had to modify WordPress to get it to work.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sorting by post_date returns last revision date’ is closed to new replies.