我有以下自定义帖子类型和自定义分类设置:
add_action( \'init\', \'create_post_type\' );
function create_post_type() {
register_post_type( \'system\',
array(
\'labels\' => array(
\'name\' => __( \'Systems\' ),
\'singular_name\' => __( \'System\' )
),
\'capability_type\' => \'post\',
\'supports\' => array(\'title\',\'editor\',\'comments\'),
\'public\' => true,
\'has_archive\' => true,
\'rewrite\' => array( \'slug\' => \'system\' ),
)
);
}
function news_init() {
register_taxonomy(
\'system\',
\'system\',
array(
\'label\' => __( \'Product Category\' ),
\'sort\' => true,
\'hierarchical\' => true,
\'args\' => array( \'orderby\' => \'term_order\' ),
\'rewrite\' => array( \'slug\' => \'product-category\' )
)
);
}
add_action( \'init\', \'news_init\' );
是否可以在URL中包含自定义分类名称?目前,当我转到自定义帖子时,URL如下所示:
如何使其看起来像以下内容?