How to run a WP_Query on both wp_posts and wp_postmeta simultaneously?
-
Hi,
Does anyone know how I can run a query that interrogates both the wp_posts table and the wp_postmeta table.
Currently I have:
$params = "post_status=publish,pending&numberposts=8&author=0"; $query = new WP_Query; $results = $query->query($params);
What I want to do is something like this:
$params = "post_status=publish,pending&numberposts=8&author=0 AND WHERE wp_postmeta dataX is equal to Y"; $query = new WP_Query; $results = $query->query($params);
Anyone any ideas on this?
Even a “it can’t be done” would be better than me tearing my hair out!
Many thanks for any help you can give me
John ??
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘How to run a WP_Query on both wp_posts and wp_postmeta simultaneously?’ is closed to new replies.