views:

89

answers:

2

I just started out using wordpress as a CMS. On the site I have 2 pages I want different posts to show on. So far I understand this small code to post only one particular category one a page (when put infront of the loop:

<?php query_posts('cat=8&showposts=5');?>

But what do I write when I need to exclude this category on my blog-page?
A link with explanations for the short codes in this snippet would be very helpful!

+1  A: 

Just add a minus to it. Example:

query_posts('cat=-3');
Björn
But will it still post the rest of the post categories that way?
VoodooBurger
Maybe then better use tagging than categories and just tag the posts you want or don't want. More info on the query_post: http://codex.wordpress.org/Template_Tags/query_posts
Björn
Thanks mate... can't believe i didn't think of that site before.
VoodooBurger
+1  A: 

You should only include the loop/category you want displayed on each page. Meaning you should have an index page and your secondary page should be a separate file within your template file. Then edit your categories accordingly.

index.php - query_posts('cat=BLOG&showposts=5');

other.php - query_posts('cat=OTHER&showposts=5');

Then create your page within the administration panel accordingly.

Mike Dyer