fbpx
How to Show Recent Posts from a Specific Category in WordPress

How to Show Recent Posts from a Specific Category in WordPress

Heres a little snippet that will display recent posts from a specific category in WordPress

<?php
     $catquery = new WP_Query( 'cat=3&posts_per_page=10' );
     while($catquery->have_posts()) : $catquery->the_post();
?>
<ul>
     <li>
          <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
          <ul>
               <li><?php the_content(); ?></li>
          </ul>
     </li>
</ul>
<?php endwhile; ?>