我有以下代码来创建自定义帖子类型和与该帖子类型关联的自定义分类法:
register_post_type('deals', array(
'label' => 'Deals',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'hierarchical' => true,
'rewrite' => array('slug' => "%make%", 'with_front' => false),
'query_var' => true,
'has_archive' => 'deals',
'exclude_from_search' => false,
'menu_position' => 4,
'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','sticky'),
'labels' => array (
'name' => 'Deals',
'singular_name' => 'Deal',
'menu_name' => 'Deals',
'all_items' => 'All Deals',
'add_new' => 'Add Deal',
'add_new_item' => 'Add New Deal',
'edit' => 'Edit',
'edit_item' => 'Edit Deal',
'new_item' => 'New Deal',
'view' => 'View Deal',
'view_item' => 'View Deal',
'search_items' => 'Search Deals',
'not_found' => 'No Deals Found',
'not_found_in_trash' => 'No Deals Found in Trash',
'parent' => 'Parent Deal',
),) );
$labels = array(
'name' => _x( 'Makes', 'taxonomy general name' ),
'singular_name' => _x( 'Make', 'taxonomy singular name' ),
'search_items' => __( 'Search Makes' ),
'all_items' => __( 'All Makes' ),
'parent_item' => __( 'Parent Make' ),
'parent_item_colon' => __( 'Parent Make:' ),
'edit_item' => __( 'Edit Make' ),
'update_item' => __( 'Update Make' ),
'add_new_item' => __( 'Add New Make' ),
'new_item_name' => __( 'New Make Name' ),
'menu_name' => __( 'Make' ),
);
register_taxonomy('make',array('deals'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'make' ),
'has_archive' => 'make'
));
正如您从运行良好的现场网站中看到的那样:http ://www.yourcardeals.co.uk/nissan-deals/
我遇到的问题是它导致常规页面 404 即http://www.yourcardeals.co.uk/manufacturers/
我已经刷新了永久链接,并且没有任何页面或类别与任何分类法或自定义帖子类型具有相同的名称或 slug。
关于可能导致这种情况的任何想法?