Tag Archives: Exclude category

WordPress: Exclude Category from Front Page – Still Show in Sidebar?

WordpressThis method will allow you to have a category “ONLY” appearing in your sidebar but excludes posts from the front page

1- Added this code to “index.php
(Notes: category # says -20, this # is the category I dont want on the front)
(also this needs to appear in your code before the loop)

(my excluded Category was 20, for more than one category use: -3,-20 (separate your categories with commas!)

2- Add the following code to your “index.php” file, but before the Loop

<?php query_posts($query_string . ‘&cat=-20’); ?>

This code will now exclude that category #20 from your home page posts BUT can be used to show up in one of yoru side bar plugins Continue reading WordPress: Exclude Category from Front Page – Still Show in Sidebar?

WordPress: Exclude a category from the RSS Feed?

1- Get the category # of the category you want “excluded” form your RSS feed
(note: in my example my category was “movies” which had a category number of 12)

2- open & edit ┬áthe “functions.php” file

3- add the following code below to the bottom of your functions.php file
(also make sure you replace the -12 with the # from step 1, add a – sign to it also)

4- Save functions.php file

4- want exclude MORE? then add more categories with commas between Continue reading WordPress: Exclude a category from the RSS Feed?