I've got multiple custom post types. Recipes and Ingredients. Recipe page contains ACF Relationship field to select ingredients. Ingredients custom posts belong to specific categories "Vegetables", "Meat"... On Ingredients Archive pages I would like to list recipes that consist of ingredients from the current category. Any help or directions would be appreciated.
$args = array(
'post_type' => 'recipes',
'meta_query' => array(
array(
'key' => 'ingredient_name', // custom field name
'value' => '"' . get_terms('ingredients_categories') . '"', // assuming that this is getting post's categories
'compare' => 'LIKE'
)
)
);