Excluding a Category from the Homepage
-
I’m trying to exclude a certain category from showing up on the homepage.
I’m using the Hamasaki theme. I changed the main loop line from:
<?php $my_query = new WP_Query(‘showposts=1’);
to
<?php $my_query = new WP_Query(‘showposts=1&cat=3’);
with category 3 encapsulating all the posts except the those in the category I want excluded.
That seemed to work, at the time, as the posts I didn’t want on the homepage disappeared. Then I went and added a ton more posts into that category and all the sudden they are all showing up on the homepage again. I assume I must have done something, but I can’t find it and don’t recall doing anything but adding more posts to that category in the in between (from when it was working to now).
To try to fix it, I also tried directly excluding the category like so:
<?php $my_query = new WP_Query(‘showposts=1&cat=-689’);
Didn’t make any difference.
Any ideas?
- The topic ‘Excluding a Category from the Homepage’ is closed to new replies.