我不得不從wp_query的wordpress數據庫中提取標題,描述和附件。我不能讓如何在同一時間取兩者附件和meta_descriptions ...Wordpress無wp函數的自定義元查詢(wo。wp_query())
這是我的查詢看起來像到目前爲止
$query="SELECT post_title, meta_value
FROM wp_posts p JOIN wp_postmeta pm ON p.ID=pm.post_id
WHERE post_status='publish'
AND post_type='page'
AND post_parent=2330
AND (meta_key='_wpseo_edit_description' OR meta_key='_wp_attached_file')
ORDER BY post_date DESC";
該查詢返回「翻番」的結果我有循環
______________________________
| post_title | meta_value |
|------------|---------------|
| title 1 | 1349 |
|------------|---------------|
| title 1 | description 1 |
|------------|---------------|
| title 2 | 1348 |
|------------|---------------|
| title 2 | description 2 |
|____________|_______________|
請閱讀[這篇文章](http://meta.stackoverflow.com/questions/271055/tips-for-asking-a-good-structured-query-language-sql-question/271056#271056)我寫了關於如何提出正確的問題,它會幫助你得到答案 – 2014-09-10 14:19:11