CPT Tours
// Register Custom Post Type
function tours_post_type() {
$labels = array(
'name' => _x( 'tours', 'Post Type General Name', 'tours_post_type' ),
'singular_name' => _x( 'tour', 'Post Type Singular Name', 'tours_post_type' ),
'menu_name' => __( 'Tours', 'tours_post_type' ),
'name_admin_bar' => __( 'Tours', 'tours_post_type' ),
'archives' => __( 'Archivos', 'tours_post_type' ),
'attributes' => __( 'Características', 'tours_post_type' ),
'parent_item_colon' => __( 'Tour principal', 'tours_post_type' ),
'all_items' => __( 'Todos los Tours', 'tours_post_type' ),
'add_new_item' => __( 'Añadir un Nuevo Tour', 'tours_post_type' ),
'add_new' => __( 'Añadir Nuevo', 'tours_post_type' ),
'new_item' => __( 'Nuevo Tour', 'tours_post_type' ),
'edit_item' => __( 'Editar Tour', 'tours_post_type' ),
'update_item' => __( 'Actualizar Tour', 'tours_post_type' ),
'view_item' => __( 'Ver Tour', 'tours_post_type' ),
'view_items' => __( 'Ver los Tours', 'tours_post_type' ),
'search_items' => __( 'Buscar Tour', 'tours_post_type' ),
'not_found' => __( 'No encontrado', 'tours_post_type' ),
'not_found_in_trash' => __( 'No se encuentra en la basura', 'tours_post_type' ),
'featured_image' => __( 'Imagen destacada', 'tours_post_type' ),
'set_featured_image' => __( 'Colocar imagen', 'tours_post_type' ),
'remove_featured_image' => __( 'Borrar imagen destacada', 'tours_post_type' ),
'use_featured_image' => __( 'Usar como imagen destacada', 'tours_post_type' ),
'insert_into_item' => __( 'Insertar al tour', 'tours_post_type' ),
'uploaded_to_this_item' => __( 'Subido a este tour', 'tours_post_type' ),
'items_list' => __( 'Lista de tours', 'tours_post_type' ),
'items_list_navigation' => __( 'Lista de navegación de tours', 'tours_post_type' ),
'filter_items_list' => __( 'Filtrar por lista los tours', 'tours_post_type' ),
);
$rewrite = array(
'slug' => 'ica-paracas-tours',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'tour', 'tours_post_type' ),
'description' => __( 'Sección para cargar los tours', 'tours_post_type' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'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',
);
register_post_type( 'tours', $args );
}
add_action( 'init', 'tours_post_type', 0 );