Q: I separated the MySQL query code into a string to make this example more readable - the string has not been changed. But is his original MySQL query string correct?
It would have saved me 2 days searching for the standard sql query that WP uses. I think this should be added to the main page:
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 10