SQL error with custom query (WordPress)

I’m just making a custom post query on wordpress. Query working well but im giving an error message on debug file;

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ‘FROM wp_posts WHERE 1=1’ at line 1

Read More

SQL query that;

SELECT wp_posts.ID 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

How can I fix that? What is the right query for that any idea?

Related posts

Leave a Reply