正如标题所述,我正在尝试向taxamony添加URL字段。
function create_post_type() {
register_post_type( \'brands\',
array(
\'labels\' => array(
\'name\' => __( \'Brands\' ),
\'singular_name\' => __( \'Brands\' )
),
\'public\' => true,
\'menu_position\' => 5,
\'supports\' => array(\'title\', \'editor\', \'thumbnail\'),
\'rewrite\' => array(\'slug\' => \'brands\')
)
);
}
add_action( \'init\', \'create_post_type\' );
function partner_taxonomy() {
register_taxonomy(
\'partners\',
\'brands\',
array(
\'hierarchical\' => true,
\'label\' => \'Partners\',
\'query_var\' => true,
\'show_ui\' => true,
\'rewrite\' => array(\'slug\' => \'partners\')
)
);
}
add_action( \'init\', \'partner_taxonomy\' );
从这里,我如何向“Partners”分类法添加URL字段?还要添加到分类中的代码。用于显示的php页面。
谢谢