Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

eBooks

Editorial de l’Escola de Cuina Romaní

if ( ! function_exists('romaní_crear_cpt_ebooks') ) {

// Register Custom Post Type
function romaní_crear_cpt_ebooks() {

	$labels = array(
		'name'                  => _x( 'eBooks', 'Post Type General Name', 'romaní_crear_cpt_ebooks' ),
		'singular_name'         => _x( 'eBooks', 'Post Type Singular Name', 'romaní_crear_cpt_ebooks' ),
		'menu_name'             => __( 'eBooks', 'romaní_crear_cpt_ebooks' ),
		'name_admin_bar'        => __( 'eBooks', 'romaní_crear_cpt_ebooks' ),
		'archives'              => __( 'Arxiu eBooks', 'romaní_crear_cpt_ebooks' ),
		'attributes'            => __( 'Item Attributes', 'romaní_crear_cpt_ebooks' ),
		'parent_item_colon'     => __( 'Parent Item:', 'romaní_crear_cpt_ebooks' ),
		'all_items'             => __( 'Tots els eBooks', 'romaní_crear_cpt_ebooks' ),
		'add_new_item'          => __( 'Afegir nou eBook', 'romaní_crear_cpt_ebooks' ),
		'add_new'               => __( 'Afegir Nou', 'romaní_crear_cpt_ebooks' ),
		'new_item'              => __( 'Nou eBook', 'romaní_crear_cpt_ebooks' ),
		'edit_item'             => __( 'Edita eBook', 'romaní_crear_cpt_ebooks' ),
		'update_item'           => __( 'Actualitza eBook', 'romaní_crear_cpt_ebooks' ),
		'view_item'             => __( 'Veure eBook', 'romaní_crear_cpt_ebooks' ),
		'view_items'            => __( 'Veure eBooks', 'romaní_crear_cpt_ebooks' ),
		'search_items'          => __( 'Cerca eBooks', 'romaní_crear_cpt_ebooks' ),
		'not_found'             => __( 'No trobat', 'romaní_crear_cpt_ebooks' ),
		'not_found_in_trash'    => __( 'No trobat a la paperera', 'romaní_crear_cpt_ebooks' ),
		'featured_image'        => __( 'Imatge destacada', 'romaní_crear_cpt_ebooks' ),
		'set_featured_image'    => __( 'Estableix la imatge destacada', 'romaní_crear_cpt_ebooks' ),
		'remove_featured_image' => __( 'Elimina la imatge destacada', 'romaní_crear_cpt_ebooks' ),
		'use_featured_image'    => __( 'Utilitza com a imatge destacada', 'romaní_crear_cpt_ebooks' ),
		'insert_into_item'      => __( 'Insereix a l'element', 'romaní_crear_cpt_ebooks' ),
		'uploaded_to_this_item' => __( 'S'ha penjat a aquest element', 'romaní_crear_cpt_ebooks' ),
		'items_list'            => __( 'Llista eBoks', 'romaní_crear_cpt_ebooks' ),
		'items_list_navigation' => __( 'Navegació per llista d'eBooks', 'romaní_crear_cpt_ebooks' ),
		'filter_items_list'     => __( 'Filtra la llista d'eBooks', 'romaní_crear_cpt_ebooks' ),
	);
	$rewrite = array(
		'slug'                  => 'eBooks',
		'with_front'            => true,
		'pages'                 => true,
		'feeds'                 => true,
	);
	$args = array(
		'label'                 => __( 'eBooks', 'romaní_crear_cpt_ebooks' ),
		'description'           => __( 'Editorial Romaní', 'romaní_crear_cpt_ebooks' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions' ),
		'taxonomies'            => array( 'category' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-reddit f195',
		'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( 'romani_ebooks', $args );

}
add_action( 'init', 'romaní_crear_cpt_ebooks', 0 );

}