You should not have to specify orderby=date
. That is the default. If you look at the query, you will see that the field used is post_date
, which is the publication date and not the modification date– post_modified
.
You can prove this just by dumping $wp_query
after your call to query_posts
. Or try:
$q = new WP_Query('posts_per_page=-1');
var_dump($q->request);
With no other parameters you get ORDER BY wp_posts.post_date DESC
.
If you are not getting that order there is already a filter that is altering default behavior. What is adding that filter I can’t guess.
And yes, please don’t use query_posts
.
It should be noted that using this to replace the main query on a page
can increase page loading times, in worst case scenarios more than
doubling the amount of work needed or more. While easy to use, the
function is also prone to confusion and problems later on. See the
note further below on caveats for details.http://codex.wordpress.org/Function_Reference/query_posts (emphasis mine)