Sign Up For Web Hosting Now!
WordPress Services
No.1 Wordpress Host
  • Free Domain name
  • Unlimited space
  • Unlimited traffic
  • 99.9% Server Uptime
  • FREE WP installation
  • Wordpress themes
  • Immediate activation
Buy web hosting
Sign up now Learn more
WordPress Hosting Award
WordPress Hosting Award
Facebook Twitter Plusone

How to display posts from a category

If you want to display posts from a single category in your WordPress theme, you should add the following line below the Loop:

<?php query_posts( 'cat=33' ); ?>

Replace 33 with your category ID. This will filter the Look showing only posts from the category you have selected. If you want to show more than one category, you can add the IDs separated with comas:

<?php query_posts( 'cat=33,44,55,66' ); ?>
Previous Next
(c) Copyright 2004-2013 SiteGround. All rights reserved
WordPress is a trademark of Free Software Foundation, Inc. SiteGround is not affiliated with or endorsed by the WordPress Project or its trademark owners.