I have spent a day searching, but to no avail.
I have an area on my site which when the user clicks on a category, I want it to only show them posts from that category, no children posts or other.
I have a parent category called "Money", which has 2 child categories - "Funds" & "Wealth".
Money/
Money/Funds/
Money/Wealth/
I've got this working:
query_posts('cat=10');
This does show only this category, but unfortunately it also shows the children of it.
And when I click on any of the child cats of this parent, it also shows posts from the parent cat and ALL child cats of the parent (not just the one I clicked on).
Now I can explicitly list each category ID I don't want to show or ONLY want to show, but doing this each time I edit or add a child of the parent is annoying, and not very practical to be honest.
I also don't want these to show in any other loops, I.E. the homepage or other category loops.
So only show them when they are specifically clicked on.
Again, using query_posts() I can eliminate certain cats on the index and other places I have the loop, but I also then have to edit these theme files to add these new IDs to stop them being shown.
Any advice?
To LIMIT them being shown (in index etc), it would be great if I could simply somehow "limit the parent and all children", without having to specifically list all IDs I want to not show.
And is there also any way to only SHOW the parent or one of the child cats when the user clicks on it WITHOUT having to edit the theme each time and add the IDs to the clauses?
Any ideas very much welcomed, as I've tried many things and scoured for a long time.
Cheers