<?php
$args = array(
'post_type'=>'weather_today',
'orderby'=>'ID',
'order'=>'ASC',
'posts_per_page'=>1
);
$query = new WP_Query($args);
if ($query->have_posts()) {
while ( have_posts() ) : the_post();
the_content();
endwhile;
}
wp_reset_postdata();
?>
Outputs a post content (the_content()
) that is not of a weather_today
type. Why is this? I checked my SQL, in wp_posts
I only have one post of post_type = "weather_today"
and it's not the one being outputted. This query is up in my header... and I believe above any other custom queries. Furthermore, it seems the other params are respected, the post I am getting is only 1
and is that last regular post by ID
.
So why is the post_type
, the most important param in this query, being ignored?