我想知道是否有一种方法可以列出当前页面的所有自定义分类法(例如,在我的single.php中)?
例如,我的分类如下
类别
H 19++RomanH 210H 111+H 212H 113-经典cH 214H 115-现代H 216f 217/code>
我想创建一个侧边栏,列出所有具有相同父母(包括其他兄弟姐妹的后代)的其他项目。“希腊语”一页将列出“罗马”和“印度”。“古”页面将包括“古>>希腊语”、“古>>罗马”、“古>>印第安”、“经典”和“现代”页面的链接。)
这与自定义分类法是可能的吗?我怎样才能做到这一点?
谢谢!
*EDIT*
此外,作为参考,我正在使用以下博客文章,这些文章更详细地了解了我的需求,我只是在根据我在最初的文章中提到的规范定制它时遇到了困难:
http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/
https://github.com/scribu/wp-query-multiple-taxonomies/wiki/Changing-templates
http://scribu.net/wordpress/extending-the-category-walker.html
发布于 2011-06-14 11:04:24
$post = get_post($id); //Get the post id
if($post->post_parent){ //If it has a parent
wp_list_pages('child_of='.$post->post_parent . '&exclude='.$id); //List the pages that are children of the parent page, excluding the current one.
}这将创建一个页面所有同级的列表。我有一种感觉,你想要的东西略有不同,因为你提到了自定义分类以及网页。这些是自定义的帖子类型、类别或页面吗?如果这对你有用,请告诉我:)
https://stackoverflow.com/questions/6336296
复制相似问题