N
N
Nikolai Novosad2016-03-20 23:38:44
WordPress
Nikolai Novosad, 2016-03-20 23:38:44

The page with custom type is not displayed?

Hello.
In the functions.php file I create a new custom type like this:

function custom_post_board() {
    $labels = array(
        'name'               => _x( 'Доска объявлений', 'post type general name' ),
        'singular_name'      => _x( 'Доска объявлений', 'post type singular name' ),
        'add_new'            => _x( 'Добавить объявление', 'product' ),
        'add_new_item'       => __( 'Добавить объявление' ),
        'edit_item'          => __( 'Редактировать объявление' ),
        'new_item'           => __( 'Новое объявление' ),
        'all_items'          => __( 'Все объявления' ),
        'view_item'          => __( 'Смотреть объявления' ),
        'search_items'       => __( 'Найти объявление' ),
        'not_found'          => __( 'Объявления не найдены' ),
        'not_found_in_trash' => __( 'Нет удаленных объявлений' ),
        'parent_item_colon'  => '',
        'menu_name'          => 'Доска объявления'
    );
    $args = array(
        'labels'        => $labels,
        'description'   => 'Доска объявлений',
        'public'        => true,
        'menu_position' => 25,
        'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'product_category'),
        'has_archive'   => true,
    );
    register_post_type( 'board', $args );
}
add_action( 'init', 'custom_post_board' );

Custom type appears in the admin panel. The page is also created. But when I click on the link - garden.web/board/sobranie I get that 'Page not found'.
What am I doing wrong?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2016-03-20
@nik_neman

Re-save the Permalinks. Settings - permalinks - save.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question