add_action( 'init', 'products_post_product' );
function add_custom_taxonomies() {
// Add new "Locations" taxonomy to Posts
register_taxonomy('Categorys', 'products', array(
// Hierarchical taxonomy (like categories)
'hierarchical' => true,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => false,
// 'hide_meta_box' => true,
// This array of options controls the labels displayed in the WordPress Admin UI
'labels' => array(
'name' => _x( 'categorys', 'taxonomy general name' ),
'singular_name' => _x( 'Categorys', 'taxonomy singular name' ),
'search_items' => __( 'Search Categorys' ),
'all_items' => __( 'All Categorys' ),
'parent_item' => __( 'Parent Categorys' ),
'parent_item_colon' => __( 'Parent Categorys:' ),
'edit_item' => __( 'Edit Categorys' ),
'update_item' => __( 'Update Categorys' ),
'add_new_item' => __( 'Add New Categorys' ),
'new_item_name' => __( 'New Categorys Name' ),
'menu_name' => __( 'Categorys' ),
),
// Control the slugs used for this taxonomy
'rewrite' => array(
'slug' => 'categorys', // This controls the base slug that will display before each term
// 'with_front' => true, // Don't display the category base before "/locations/"
// 'hierarchical' => false // This will allow URL's like "/locations/boston/cambridge/"
),
)
);
}以上是我的代码:但我的分类法术语页是重定向到页,而不是找到页面。我的url hhtp://url.com/ .Am - 404页.Need i在代码中有任何错误,或者我必须将页面重定向到其他页面,或者我必须创建其他页面,我的分类法片段.Need帮助
发布于 2016-09-01 11:07:32
以上是我的代码:但我的分类法术语页是重定向到页,而不是找到页面。我的url hhtp://url.com/ .Am - 404页.Need i在代码中有任何错误,或者我必须将页面重定向到其他页面,或者我必须创建其他页面,我的分类法片段.Need帮助
Ans :需要为您的分类法创建文件,例如分类法- create ys.php作为您的分类法名称,在分类法单词之前使用。
https://stackoverflow.com/questions/39264739
复制相似问题