How to to exclude a WordPress category from index/blog page

68 views
asked Dec 7, 2012 in Website Builder by DinoGuy (2,130 points)
Hi
I am using a category for a page, and I want exclude the posts of this category  from the main blog page.
Right now I am using this :<?php query_posts($query_string . '&cat=-4'); ?> But it this didn’t work as desired. Does anyone here know how to achieve this?
Thank you all

1 Answer

0 like 0 dislike
answered Dec 7, 2012 by WebGuru (9,280 points)
hi
Try checking the value of the  $query_string. Use WP_Query instead
...