简体   繁体   English

完整的WordPress自定义帖子类型类别树

[英]Complete WordPress custom post type category tree

I have post type called 'sisallot', which has 5 subcategories. 我有一个叫做“ sisallot”的帖子类型,它有5个子类别。 Lets call these subcats s1,s2,s3,s4,s5. 让我们将这些子类别称为s1,s2,s3,s4,s5。 Every subcategory has a couple of subcategories (these would then be ss1,ss2..etc.) and these ssubcategories has the final posts to get. 每个子类别都有几个子类别(然后是ss1,ss2..etc等),这些子类别都有最终的帖子。

I've added first level subcategories to my navbar. 我已经在导航栏中添加了第一级子类别。

The question is: 问题是:

How can I create such category.php -template loop that loops subcategories(ss1,ss2,ss3..etc.) and their titles and excerpts, of its parent category ( s1,s2,s3...etc.) 我如何创建这样的category.php -template循环,使子类别(ss1,ss2,ss3..etc)及其父类别(s1,s2,s3 ...等)的标题和摘录循环。

http://codex.wordpress.org/Function_Reference/get_categories http://codex.wordpress.org/Function_Reference/get_categories

Use that child_of parameter to list only categories that are children of one parent. 使用那个child_of参数仅列出属于一个父级的子级的类别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM