【发布时间】:2013-02-14 19:52:45
【问题描述】:
我有两套网站分类法,默认的 WP 类别,另一套是我通过 functions.php 为内容类型('type')创建的
add_action( 'init', 'content_taxonomy', 0 );
function content_taxonomy() {
register_taxonomy(
'type',
'post',
array(
'hierarchical' => true,
'label' => 'Type of Content',
'query_var' => true,
'rewrite' => false
)
);
};
然后,在我的 category.php 文件中,我想在单个 WP 类别中显示所有帖子,然后能够按其下方的内容类型类别过滤它们(链接到视频的帖子、博客帖子、文章, ETC)。所以,我的循环如下:
$category = get_category( get_query_var( 'cat' ) );
$cat_id = $category->cat_ID;
query_posts('cat=".$cat_id.", 121') // 121 Being the Video Custom Taxonomy
然后我跟进循环。但是,我似乎无法让它显示自定义分类类别,它只是抓取 WP 类别。
【问题讨论】: