Hi I want to display a specific category from a custom query in WordPress. My code works fine and it gets the latest 4 posts, but what I want now is to retrieve a specific category. My code is below thanks :
global $wpdb;
$posts = $wpdb->get_results(
'SELECT ID, post_title AS title, post_excerpt AS excerpt
FROM '.$wpdb->posts.'
WHERE post_type = "post"
AND post_status = "publish"
ORDER BY post_date DESC
LIMIT 4'
);