Display Posts From Single Category in a page

 

                                                                                                            <?php
                                                                                                               // The Query
                                                                                                               query_posts( array ( 'category_name' => 'uncategorized', 'posts_per_page' => 4 ) );
                                                                                                               ?>
                           
                                                                                            <?php while ( have_posts() ) : the_post();
                                                                                                                       echo '<h1>';
                                                                                                                       the_title();
                                                                                                                       echo '</h1>';
                                                                                                                       the_excerpt();
                                                                                                                       echo get_the_time( 'j.n.Y'); 
                                                                                                                       echo ' <p class="postinfo">Written by: ';
                                                                                                                       the_author_posts_link();
                                                                                                                       echo 'Posted on ';
                                                                                                                       the_date();
                                                                                                                       echo 'Categories: ';
                                                                                                                       the_category(', ');
                                                                                                                       echo '</p>';
                                                                                                                       endwhile; ?>

                                                                                                                         <?php

                                                                                                                         // Reset Query
                                                                                                                         wp_reset_query();

                                                                                                                         ?>