Show Posts on a Page
-
Hi There,
I am trying to create a page that has some general information and then shows below all posts from a certain category
I am using a page template file and have added the following code
<?php
if ($page_id=376){
query_posts(‘cat=23’);
};
if ($page_id=389){
query_posts(‘cat=44’);
};
if ($page_id=’396′){
query_posts(‘cat=65’);
};
if ($page_id=’397′){
query_posts(‘cat=66’);
};
?>
Basically if the page id is 376 then I would like show all the posts from category 23.
At the moment it only seems to be showing posts from category 66 (last one) no matter what page. Im assuming I need to put a elseif somewhere but I cannot figure it out.Is there an easier way of doing this- plugin maybe?
Thanks
Richard
- The topic ‘Show Posts on a Page’ is closed to new replies.