The theme I'm working with has a custom post type, "portfolio", inside a custom taxonomy, "portfoliocat" (post type and taxonomy definitions here). It is working ok: in the backup menu I can see the "Portfolio" option, from where I can create posts of this custom type, or categories to group those posts.
I tried to make a custom widget that lists all the categories in the "portfoliocat" taxonomy, and all the posts under each category. Something like:
= Portfoliocat === Category 1 ===== Post 1_1 ===== Post 1_2 === Category 2 ===== Post 2_1 ===== Post 2_2
Instead, this is what I get:
= Portfoliocat === Category 1 ===== Post 1_1 ===== Post 1_2 ===== Post 2_1 ===== Post 2_2 === Category 2 ===== Post 1_1 ===== Post 1_2 ===== Post 2_1 ===== Post 2_2
That is, for each category I get all the posts that belong to the taxonomy, no matter what category they belong to (instead of those ones that, belonging to the taxonomy, also belong to the category). Code here.
I think the problem is around line 36, when defining "$categoryArgs". No matter what value I assign to the 'category' key, or if I remove it totally, I still get all the posts in the taxonomy.
I have also tried using 'term' instead of 'category' with the same result.
I'd really appreciate some help on this issue.