I have a custom taxonomy of Species and a custom post type of Animals. I would like to display them in a tree view like so:
Fish (taxonomy term)
- Shark (Custom Post Type)
- Sun Fish
Each item in the list would be linked to its respective place. So the custom post types link to the animal and the taxonomy terms go to the taxonomy page. I'm aware of ways for WordPress to list categories, but I would also like the posts grouped under each category (custom taxonomy) as well.
get_terms()to fetch your list of custom categories: As you loop through your categories, you can grab all the posts in that category using
get_posts()(see here for an example of getting all posts in a given custom taxonomy).