Skip to content

Devi Sri Mari Blog:: Web Technology Trends, News, and Social Media

Menu
  • About Me
  • CONTACT US
  • Sample Page
  • WEB DEVELOPMENT
Menu

How to display posts from a category in WordPress?

Posted on January 24, 2014

wordpress

To display posts from a single category in your WordPress theme, you should add the following code below the Loop:

<?php query_posts( ‘cat=34’ ); ?>

This code will only showing posts from the category (34) you have selected.

If you want to show posts from more than one category, you can add the IDs separated with commas:

<?php query_posts( ‘cat=33,44,55,66’ ); ?>

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • “Who needs Superheros when there is a Real hero and she is called as Mother”
  • Improve Your Business Behind Social Media
  • Single-Page Application Benefits and How it Works
  • World Sparrow Day
  • Google’s ‘Mobilegeddon’ Will Affect Search Results
  • How To Use Google’s New Blocked Resources Report
  • Wikipedia Lists Ten Most Edited Pages Of 2014
  • Google Is Shutting Down The Google Earth API
  • Google Maps App Adds Real-Time Weather & Facts
  • Google Maps App Gets Design Revamp
©2025 Devi Sri Mari Blog:: Web Technology Trends, News, and Social Media | Design: Newspaperly WordPress Theme