i need a list of the latest post published by various authors, but filtered by category, like for example the latest posts of author that write about music.
i wrote this query and looks like working in mysql
SELECT * FROM ( SELECT * FROM $wpdb->posts INNER JOIN wp_term_relationships ON $wpdb->posts.ID = wp_term_relationships.object_id WHERE wp_term_relationships.term_taxonomy_id = 7 AND $wpdb->posts.post_status = 'publish' ORDER BY $wpdb->posts.post_date DESC ) AS x GROUP BY post_author
(the 7 is just an example category id)
i just would like to know the other
$wpdb functions to call the
wp_term_relationships table and if is there something wrong with this query
thank you in advance