カスタム投稿タイプのブログ アーカイブ ページへのリダイレクトを停止するにはどうすればよいですか? または、カスタム投稿タイプを表示する別のページを作成できますか?
展示用のカスタム投稿タイプの作成:
add_action('init','exhibits_custom_init');
function exhibits_custom_init(){
$labels = array(
'name' => _x('Exhibits', 'post type general name'),
'singular_name' => _x('Exhibit', 'post type singular name'),
'add_new' => _x('Add New', 'exhibit'),
'add_new_item' => __('Add New Exhibit'),
'edit_item' => __('Edit Exhibit'),
'new_item' => __('New Exhibit'),
'view_item' => __('View Exhibit'),
'search_items' => __('Search Exhibits'),
'not_found' => __('No Exhibits Found'),
'not_found_in_trash' => __('No Exhibits Found in Trash'),
'parent_item_colon' => '',
'menu_name' => 'Exhibits'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'exhibit'),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','thumbnail','editor'),
'taxonomies' => array('post_tag','post_category')
);
register_post_type('exhibit',$args);
}
function my_taxonomies_exhibit(){
$labels = array(
'name' => _x( 'Exhibit Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Exhibit Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Exhibit Categories' ),
'all_items' => __( 'All Exhibit Categories' ),
'parent_item' => __( 'Parent Exhibit Category' ),
'parent_item_colon' => __( 'Parent Exhibit Category:' ),
'edit_item' => __( 'Edit Exhibit Category' ),
'update_item' => __( 'Update Exhibit Category' ),
'add_new_item' => __( 'Add New Exhibit Category' ),
'new_item_name' => __( 'New Exhibit Category' ),
'menu_name' => __( 'Exhibit Categories' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
);
register_taxonomy( 'post_category', 'exhibit', $args );
}
add_action( 'init', 'my_taxonomies_exhibit', 0 );
このカスタム投稿タイプは、ブログ アーカイブ ページにリダイレクトします。コンテンツページや別ページに表示したい。