Loma-asunto
// Register Custom Post Type
function kohde_post_type() {
$labels = array(
'name' => _x( 'Kohteet', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Kohde', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Kohteet', 'text_domain' ),
'name_admin_bar' => __( 'Kohde', 'text_domain' ),
'archives' => __( 'Kohteet', 'text_domain' ),
'attributes' => __( 'kohteen attribuutit', 'text_domain' ),
'parent_item_colon' => __( 'Kohteen yläsivu:', 'text_domain' ),
'all_items' => __( 'Kaikki kohteet', 'text_domain' ),
'add_new_item' => __( 'Lisää uusi kohde', 'text_domain' ),
'add_new' => __( 'Lisää uusi', 'text_domain' ),
'new_item' => __( 'Uusi kohde', 'text_domain' ),
'edit_item' => __( 'Muokkaa kohdetta', 'text_domain' ),
'update_item' => __( 'Päivitä kohde', 'text_domain' ),
'view_item' => __( 'Näytä kohde', 'text_domain' ),
'view_items' => __( 'Näytä kohteet', 'text_domain' ),
'search_items' => __( 'Hae kohteista', 'text_domain' ),
'not_found' => __( 'Ei löytynyt', 'text_domain' ),
'not_found_in_trash' => __( 'Ei löytynyt roskakorista', 'text_domain' ),
'featured_image' => __( 'Kohdekuva', 'text_domain' ),
'set_featured_image' => __( 'Aseta kohdekuva', 'text_domain' ),
'remove_featured_image' => __( 'Poista kohdekuva', 'text_domain' ),
'use_featured_image' => __( 'Käytä kohdekuvana', 'text_domain' ),
'insert_into_item' => __( 'Lisää kohteeseen', 'text_domain' ),
'uploaded_to_this_item' => __( 'Lataa', 'text_domain' ),
'items_list' => __( 'Kohdelista', 'text_domain' ),
'items_list_navigation' => __( 'Kohdevalikko', 'text_domain' ),
'filter_items_list' => __( 'Suodata kohteita', 'text_domain' ),
);
$rewrite = array(
'slug' => 'majoitus',
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => __( 'Kohde', 'text_domain' ),
'description' => __( 'Kohde (Yyteri Beach Lomakeskus', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 20,
'menu_icon' => 'dashicons-admin-home',
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'kohde', $args );
}
add_action( 'init', 'kohde_post_type', 0 );