Category template that excludes child categories?
-
I’m trying to create a parent category template that excludes the posts from child categories.
When I create a post for the child category, I only check-off the box for the child category, instead of both the parent category and the child category.
Then, I’ve been messing with query_posts, which is real close to what I want but not close enough. If I pass the cat=5 parameter, it still lists posts from the child categories.
If I pass cat=5, -6, -7,
that does the trick perfectly – however, I regularly add child categories to this parent category, which means I’ll have to keep editing the parameter list in query_posts. Of course I’d rather not.Is there a better way to do this?
Thanks
- The topic ‘Category template that excludes child categories?’ is closed to new replies.