title: Display posts from specific category in wordpress
body: <p>With this query i get the posts i need from my wordpress db. What i have to do to get the posts from a specific category? </p>
  
  <pre><code>$sql = "select DISTINCT  wp_posts.id, wp_posts.post_title, wp_posts.post_excerpt, wp_posts.guid, wp_posts.post_type, featured_image.guid as post_image, wp_posts.post_modified, wp_users.display_name
  from wp_posts 
  inner join wp_postmeta on wp_posts.id = wp_postmeta.post_id and wp_postmeta.meta_key = '_thumbnail_id' 
  inner join wp_posts as featured_image on featured_image.id = wp_postmeta.meta_value
  inner join wp_users on wp_users.id = wp_posts.post_author
  where  wp_posts.post_status =  'publish' 
  AND DATE_FORMAT(wp_posts.post_date, '%d-%m-%Y')='$mydate'
  order by wp_posts.ID desc
  limit 20";
  </code></pre>