Display Posts from a Specific Category Only
-
Hello,
I’ve created a news page on my WordPress 3.3 website. I want to display only posts that are created using the “news” category on this page.
I was using this code, but it pulls in all posts, no matter what category they are tagged in:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>I have tried using this in my code:
<?php query_posts($query_string . '&cat=4'); ?>But I don’t think I’m querying posts correctly. It looks like the news page I made is only querying the content from that specific page. I would like this page to act like the homepage when I set the posts page to a specific page (I have already done that for a page called Blog).
Thanks
The topic ‘Display Posts from a Specific Category Only’ is closed to new replies.