<?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();
?>
输出帖子内容(the_content()
) 那不是weather_today
类型为什么会这样?我检查了我的SQL,在wp_posts
我只有一个职位post_type = "weather_today"
而且它不是被输出的那个。此查询位于我的标题中。。。我相信以上任何其他自定义查询。此外,似乎其他参数都受到尊重,我得到的职位只是1
最后一篇文章是ID
. 那么为什么post_type
, 是否忽略此查询中最重要的参数?