some of my posts have the post meta of "project_id". How can I retrive all the posts which have the meta key of "project_id" ? I tried:
$meta_key = 'project_id'; return $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key));
It returns nothing. Please help! Thanks!