List Taxonomy terms along with their posts

Question

I am trying to make a list of all my posts in a custom post type by the taxonomy term e.g.

Term name 1
– post 1
– post 2
– post 3

Term name 2
– post 1
– post 2
– post 3

Term name 3
– post 1
– post 2
– post 3

I have found the function which lists the terms (get_terms) but can’t work out a way to list the terms but also list the posts.

Any help is appreciated

0
Gareth Gillman 1 month 0 Answers 6 views 0

Leave an answer