Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

custom post type

// Register Custom Post Type
function hoteles_post_type() {

	$labels = array(
		'name'                  => _x( 'hoteles', 'Post Type General Name', 'hoteles_domain' ),
		'singular_name'         => _x( 'hoteles', 'Post Type Singular Name', 'hoteles_domain' ),
		'menu_name'             => __( 'Hoteles', 'hoteles_domain' ),
		'name_admin_bar'        => __( 'Hoteles', 'hoteles_domain' ),
		'archives'              => __( 'Archivos', 'hoteles_domain' ),
		'attributes'            => __( 'Atributos', 'hoteles_domain' ),
		'parent_item_colon'     => __( 'Hoteles padre', 'hoteles_domain' ),
		'all_items'             => __( 'Todos Los Hoteles', 'hoteles_domain' ),
		'add_new_item'          => __( 'Agregar Nuevo Hotel', 'hoteles_domain' ),
		'add_new'               => __( 'Agregar Nuevo', 'hoteles_domain' ),
		'new_item'              => __( 'Nuevo', 'hoteles_domain' ),
		'edit_item'             => __( 'Editar', 'hoteles_domain' ),
		'update_item'           => __( 'Actualizar', 'hoteles_domain' ),
		'view_item'             => __( 'Ver', 'hoteles_domain' ),
		'view_items'            => __( 'Ver Hoteles', 'hoteles_domain' ),
		'search_items'          => __( 'Buscar Hoteles', 'hoteles_domain' ),
		'not_found'             => __( 'Not found', 'hoteles_domain' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'hoteles_domain' ),
		'featured_image'        => __( 'Imagen Destacada', 'hoteles_domain' ),
		'set_featured_image'    => __( 'Establecer como imagen destacada', 'hoteles_domain' ),
		'remove_featured_image' => __( 'remover imagen destacada', 'hoteles_domain' ),
		'use_featured_image'    => __( 'usar como imagen destacada', 'hoteles_domain' ),
		'insert_into_item'      => __( 'insertar dentro de hoteles', 'hoteles_domain' ),
		'uploaded_to_this_item' => __( 'Subir a Hoteles', 'hoteles_domain' ),
		'items_list'            => __( 'Lista de Hoteles', 'hoteles_domain' ),
		'items_list_navigation' => __( 'Lista de Navegacion de hoteles', 'hoteles_domain' ),
		'filter_items_list'     => __( 'Filtrar lista de Hoteles', 'hoteles_domain' ),
	);
	$rewrite = array(
		'slug'                  => 'hoteles_post_type',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'hoteles', 'hoteles_domain' ),
		'description'           => __( 'contenidos de hoteles', 'hoteles_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'comments', 'page-attributes', 'post-formats' ),
		'taxonomies'            => array( 'category', 'post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-building',
		'show_in_admin_bar'     => true,
		'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( 'hoteles_type', $args );

}
add_action( 'init', 'hoteles_post_type', 0 );