I have several post types:
- Products
- Reviews
- Showcases
- Manufacturers
Those are the two most important for this question
Reviews and Showcases are about a product, so when an user adds a review or showcase, they have to select the product trough an ACF relationship field
.
When a user adds a product, they have to select the Manufacturer trough an ACF post object field
I have created all my custom pages for the reviews, product and showcases, now I arrived at the Manufacturer post type. What I want here and am unable to achieve is show the latest 5 reviews, products and showcases with this manufacturer.
I know how to create a query etc, but have no idea what arguments to set in order to filter reviews and showcases (they work the same way, two levels nested) and products (one level nested) for that specific manufacturer.
Can somebody please post me in the right direction?
When you create an Query, you can ask for different post types in a query with givin an array of post types:
In addition to that you can make a meta_query within this WP_Query in order to ask for the associated manufacturer:
See the docs here.