How to display post from a category in wordpress? Simply copy and paste the code in your php file and change the category id which one you want to show. <h4>Latest Post</h4> <ul class="list-blog"> <?php query_posts(array('category__in' => array(4),'posts_per_page' => 4)); while(have_posts()) { the_post(); ?> <li> <?php $post_thumbnail_id = get_post_thumbnail_id($post->ID); $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id ); if($post_thumbnail_url!='') { $post_thumbnail_url = $post_thumbnail_url; }else { $post_thumbnail_url = get_template_directory_uri().'/img/noimg.jpg'; } ?> <img width="60" height="60" alt="" class="