WordPress/ all my category posts show on my homepage as well

107 views
asked Feb 16, 2013 in Website Builder by Susan3 (880 points)
Hi all..
I have a home page and 2 additional pages. I made categories and so far everything I was posting was going to the home page. Then added a template with a different category to go on the other page. Now when I make a post on this new page, the posts appears on the home page as well. How do I make the post shows only on my new page and not the home page (depending on the category)
Can anyone please help?
Thanks

2 Answers

0 like 0 dislike
answered Feb 16, 2013 by expert (14,380 points)
In your page.php file or index.php file add the following line
<?php global $query_string; query_posts( $query_string . '&cat=-4,7'); ?>
(4 and 7 being the category ID that you don’t want to show in the home page)
0 like 0 dislike
...