How to Exclude Category Posts in WordPress Main Blog page?

196 views Asked by At

I am trying to exclude posts with the 'news' category and I seem to be having some trouble. I did not write the original code and haven't really used WordPress much, so any relevant resources and solutions are helpful. Here is the code that is currently being used but shows all posts including 'news'

<?php query_posts('post_type=post&post_status=publish&paged='. get_query_var('paged') .'&cat=-news'); ?>

1

There are 1 answers

0
dr Oq On

instead of using 'news' in the parameters, change it to the id of the category which can be found by going to posts>categories>news page's url. it should be something along the lines of category&tag_ID=52&post_type=post where 52 is the id.