1

I am building a 'course-like' WP site, without the use of any particular 'course plugins' and for this, I need to be able to show all the sub-categories in the sidebar for that particular course.

Example: I have a course about cooking. Here are the Categories (parents in bold) and sub-categories (along with posts in Italics)...

A Food Course (Parent) Preparing food (SubCat) - Washing hands - Hair nets - What tools to use Using Ingredients (SubCat) - Storage - Use-by Dates

So, if the user is on a post page (say Hair Nets), then in the sidebar, I need to display the menu structure for that particular Parent Category, so they can skip to other sections just in that course, quickly.

I know, to generate the menu I would need to get/retrieve the parent category of the current post, can anyone shed any light?

  • And could extend your example and show, what exactly should be printed in sidebar in this case? – Krzysiek Dróżdż Dec 5 '18 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.