-
Martin
I know this is a long shot and was hoping I would be able to do it with the GB Query Loop but can’t see how.
What I want to do is list all categories in a page and group the posts of each category under each Category Heading.
If you think of it in terms of meals; Breakfast, Lunch, Dinner
BREAKFAST (Category)
– Full English (post – link to post)
– Cereal (post – link to post)
– Fruit (post – link to post)
– Bacon Butty (post – link to post)LUNCH (Category)
– Salad (post – link to post)
– Fish and Chips (post – link to post)
– Lasagne (post – link to post)DINNER (Category)
– Steak (post – link to post)
– Vegetarian (post – link to post)
– Soup and Sandwich (post – link to post)
– Baked Potato (post – link to post)Any tips would be appreciated immensely.
Thanks for reading.
Martin
-
Hi Martin,
Do you want to do it on a static page?
If so, you can create those sections using container and query loop like this.
- container -- static headline (BREAKFAST) -- query loop (select category as taxonomy, select the Breakfast category) - container -- static headline (LUNCH) -- query loop (select category as taxonomy, select the Lunch category) - container -- static headline (DINNER) -- query loop (select category as taxonomy, select the Dinner category)
-
Martin
Sorry, I should have said; the Breakfast, Lunch and Dinner example was just an example.
I want to loop through however many categories exist for the post type. They are not preset like Breakfast, Lunch and Dinner.
-
Do you mean automatically loop through the categories?
If so, no that’s not possible. you need to manually add the categories.
Or you need to write custom code for it.
-
Martin
Yes, automatically loop through categories.
I am not surprised it’s not possible with a query loop.
Thanks for giving it your time.
Martin
-
You are welcome 🙂
- You must be logged in to reply to this topic.