admin管理员组文章数量:1130349
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?
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?
本文标签: postsHow do I retrieve then print the currently viewed sub categories
版权声明:本文标题:posts - How do I retrieve then print the currently viewed sub categories? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749126752a2319909.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论