Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

CPT Podcasts

Crear un custom post type para podcasts

if ( ! function_exists('rucarpe_podcast_cpt') ) {

// Register Custom Post Type
function rucarpe_podcast_cpt() {

	$labels = array(
		'name'                  => _x( 'Podcasts', 'Post Type General Name', 'rucarpe_podcast_td' ),
		'singular_name'         => _x( 'Podcast', 'Post Type Singular Name', 'rucarpe_podcast_td' ),
		'menu_name'             => __( 'Podcasts', 'rucarpe_podcast_td' ),
		'name_admin_bar'        => __( 'Podcasts', 'rucarpe_podcast_td' ),
		'archives'              => __( 'Podcasts', 'rucarpe_podcast_td' ),
		'attributes'            => __( 'Atributos podcast', 'rucarpe_podcast_td' ),
		'parent_item_colon'     => __( 'Podcast padre', 'rucarpe_podcast_td' ),
		'all_items'             => __( 'Todos los podcasts', 'rucarpe_podcast_td' ),
		'add_new_item'          => __( 'Añadir nuevo podcast', 'rucarpe_podcast_td' ),
		'add_new'               => __( 'Añadir nuevo', 'rucarpe_podcast_td' ),
		'new_item'              => __( 'Nuevo podcast', 'rucarpe_podcast_td' ),
		'edit_item'             => __( 'Editar podcast', 'rucarpe_podcast_td' ),
		'update_item'           => __( 'Actualizar podcast', 'rucarpe_podcast_td' ),
		'view_item'             => __( 'Ver podcast', 'rucarpe_podcast_td' ),
		'view_items'            => __( 'Ver podcasts', 'rucarpe_podcast_td' ),
		'search_items'          => __( 'Buscar podcast', 'rucarpe_podcast_td' ),
		'not_found'             => __( 'No encontrado', 'rucarpe_podcast_td' ),
		'not_found_in_trash'    => __( 'Ningún podcast en la papelera', 'rucarpe_podcast_td' ),
		'featured_image'        => __( 'Imagen destacada', 'rucarpe_podcast_td' ),
		'set_featured_image'    => __( 'Establecer imagen destacada', 'rucarpe_podcast_td' ),
		'remove_featured_image' => __( 'Eliminar imagen destacada', 'rucarpe_podcast_td' ),
		'use_featured_image'    => __( 'Usar como imagen destacada', 'rucarpe_podcast_td' ),
		'insert_into_item'      => __( 'Insertar en podcast', 'rucarpe_podcast_td' ),
		'uploaded_to_this_item' => __( 'Subido a este podcast', 'rucarpe_podcast_td' ),
		'items_list'            => __( 'Lista de podcast', 'rucarpe_podcast_td' ),
		'items_list_navigation' => __( 'Lista de navegación de podcast', 'rucarpe_podcast_td' ),
		'filter_items_list'     => __( 'Filtrar lista de podcast', 'rucarpe_podcast_td' ),
	);
	$args = array(
		'label'                 => __( 'Podcast', 'rucarpe_podcast_td' ),
		'description'           => __( 'Custom Post Type Podcast', 'rucarpe_podcast_td' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail' ),
		'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,
		'capability_type'       => 'page',
	);
	register_post_type( 'rucarpe_cpt_podcast', $args );

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

}