Retrieval of multiple posts in WordPress is almost always handled by WP_Query
class (or get_posts()
function that wraps it).
There is quite a lot of documentation and information to it, but to narrowing it down to your specific case you will need to:
- set up posts loop for each term
- pass as arguments to each loop:
- your post type
- desired number of posts
- current term you wish to fetch posts for (see “taxonomy parameters” section in docs)