Forum
Filtering by nested categories
I want to be able to have a page that pulls in a category using content_custom, but also has a separate panel on the page that displays content from a nested category of that original category.
So, say, the original category is 'deforestation', and then the nested sub-category is 'palm oil'.
I have nested the category, and been able to pull the nested category onto the page. However, the problem I have is that the call to the original category also displays the nested category.
So I want to call content_custom with:
'category' => "analysis/deforestation" to get all the articles that are 'deforestation'
I want to call content_custom with:
'category' => "analysis/deforestation/palm-oil" to get the articles from the nested category.
But the first call also brings in the articles from the palm-oil category. How would I exclude them from the first call?
Everything in
palm-oil
is indeforestation
by nature of it being a sub category.I get that, but is there no way to filter out the sub-categories for certain calls? Or any work-arounds you could suggest?
This is the first time anyone's asked for that, so no, there's no proposed solution currently.