簡體   English   中英

從WP_Query獲取沒有內容的帖子數組

[英]Get array of posts without content from WP_Query

我使用以下代碼獲取帖子列表

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

在這種情況下,我會獲取數組中每個帖子的內容和其他內容。 但是我不需要內容,它可以很大。 我可以從結果數組中排除內容以提高性能嗎?

嘗試使用wpdb來獲取數據。 訪問: http : //codex.wordpress.org/Class_Reference/wpdb

可能會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM