首页 文章

在数组中获取自定义帖子类型的自定义分类的条款

提问于
浏览
-1

我有一个自定义的帖子类型'事件'和分类 - '事件类型' . 如何在数组中获取属于自定义分类“事件类型”的所有术语 . 我使用wp_list_categories($ args)但它给出了Ali标签中每种类型的输出 .

请帮帮我

注册分类法的代码

<?php
function event_init() {
    // create a new taxonomy
    register_taxonomy(
        'Event types',
        'events',       
        array(
            'labels' => array(
                            'name'=>'Event types',
                            'add_new_item'=>'Add New Event types ',
                            'new_item_name'=>"New Event types"              
                            ),

            'show_ui' => true,
            'show_tagcloud' => false,
            'hierarchical' => true,
            'rewrite' => array( 'slug' => 'event-type' ),



             )
    );
}
add_action( 'init', 'event_init' );

?>

2 回答

相关问题