Hello this is my query. I want to show the titles of posts that have fullfil the following but it doesn't show anything, I don't know. Thank you! Also, is there another way to show the results, more wordpress-like?
<?php
$theposts = $wpdb->get_results("SELECT post_title FROM $wpdb->posts
WHERE ID IN
(
SELECT DISTINCT post_id
FROM $wpdb->postmeta
WHERE meta_key = 'extra1' AND meta_value = 'test'
)");
foreach ($theposts as $thepost) {
echo $thepost->post_title;
}
?>