I'm working on a pictures gallery, where there is no 'regular' post, only images with several custom taxonomies, some of them being hierarchical.
I use wp_list_categories()
to display hierarchical lists of terms and that works fine provided I set the hide_empty
parameter to 0
.
However, I would like to display only terms that have pictures, or whose descendants have pictures. But I can't find a way to use hierarchical
instead of hide_empty
, probably because the function looks for terms attached to regular posts.
Is there a way to change its behaviour and make it look for post-type='attachment'
or whatever, so I could list only terms related to published pictures?
Thanks for helping.