从WP_Query获取没有内容的帖子数组

时间:2014-04-28 11:58:07

标签: php wordpress wp-query

我使用以下代码获取帖子列表

$the_query = new WP_Query($args);
while ($the_query->have_posts()) {
    $the_query->the_post();
    //work with post
}

在这种情况下,我获得了数组中每个帖子的内容和其他内容。但我不需要内容,它可能相当大。我可以从结果数组中排除内容以提高性能吗?

1 个答案:

答案 0 :(得分:1)

尝试使用wpdb获取数据。访问:http://codex.wordpress.org/Class_Reference/wpdb

愿这有帮助。

相关问题