我有以下代码来创建自定义帖子类型和与该帖子类型相关联的自定义分类:
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的页面或类别。
关于可能导致此问题的任何想法?