我不得不从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