Hi
I use the ACF for a custom post type for displaying recipes. And I need some help with showing the posts. I have tried to use WP default category, ACF category, ACF taxonomy, ACF select an so on…
What I’m trying to do is to sort my posts in the custom post type by recipe categories, like:
RECIPECAT1
Recipe1
Recipe2
Recipe 3…
RECIPECAT2
Recipe4
Recipe5
Recipe 6…
I have succeeded with displaying the posts, but not sorted like above.
And I don’t now how to solve this the best way.
Any idea anyone?
Regards Malin
Hi,
I think I may have an idea on that one, you could create a category called
“Recipes” in that category you would have te following child categories “RecipeCAT1, RecipeCAT2, RecipeCAT3” and so on…
when you create a post you asign “Recipes” and “RecipeCAT1” as categories.
then you could get all the “RecipeCAT” in an array with get_terms
and inside a foreach loop put a wp_query that will get you the post from each RecipeCAT and display them one after the other.