How to display posts from a category in WordPress

How to display posts from a category in WordPress

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' ); ?>

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.