Query WordPress Categories

Webmaster WordPress Leave a Comment

Query Category Posts for WordPress 

This query_posts() is a way to query categories and display post from inside any WordPress template.

<php query_posts('cat=72&showposts=4'); ?>

Place the post query before the post opening php in a theme template file.


<php query_posts('cat=72&showposts=4'); ?>

<php if (have_posts()) : ?>

Leave a Reply

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