Все понял почему файл не подхватывался…
Было так (файл archive-news.php не подхватывался)
if ( ! function_exists( 'news_cp' ) ) {
function news_cp(){
register_post_type('news', array(
'labels' => array(
'name' => 'Новости',
'singular_name' => 'Новость',
'add_new' => 'Добавить новость',
'add_new_item' => 'Добавление новости',
'edit_item' => 'Редактирование новости',
'new_item' => 'Новая новость',
'view_item' => 'Смотреть новость',
'search_items' => 'Искать новость',
'not_found' => 'Не найдено',
'not_found_in_trash' => 'Не найдено в корзине',
'parent_item_colon' => '',
'menu_name' => 'Новость',
),
'public' => true,
'menu_position' => 4,
'menu_icon' => 'dashicons-warning',
'hierarchical' => false,
'supports' => array('title','editor','thumbnail','excerpt','post-formats'),
// 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats'
) );
}
add_action('init', 'news_cp');
}
а так начал подхватываться и ошибка 404 ушла
add_action( 'init', 'news_cp' );
function news_cp() {
$labels = array(
'name' => 'Новости',
'singular_name' => 'Новость',
'add_new' => 'Добавить новость',
'add_new_item' => 'Добавление новости',
'edit_item' => 'Редактирование новости',
'new_item' => 'Новая новость',
'all_items' => 'Все новости',
'view_item' => 'Просмотр новости на сайте',
'search_items' => 'Искать новость',
'not_found' => 'Новости не найдены.',
'not_found_in_trash' => 'В корзине нет новостей.',
'menu_name' => 'Новости'
);
$args = array(
'labels' => $labels,
'public' => true,
'show_ui' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-layout',
'menu_position' => 5,
'supports' => array('title', 'editor', 'thumbnail')
);
register_post_type( 'news', $args );
}
Всем спасибо