简体   繁体   中英

Get array of posts without content from WP_Query

I use following code to get list of posts

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

in this case I get the content and other stuff for each post in the array. But I don't need content, it can be rather big. Can I exclude content from the result array to improve performance?

Try wpdb to fetch data. visit: http://codex.wordpress.org/Class_Reference/wpdb

May this help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM