Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

ebook

// Register Custom Post Type
function ebook_post_type() {

	$labels = array(
		'name'                => _x( 'EBooks', 'Post Type General Name', 'authorpad' ),
		'singular_name'       => _x( 'EBook', 'Post Type Singular Name', 'authorpad' ),
		'menu_name'           => __( 'EBook', 'authorpad' ),
		'parent_item_colon'   => __( 'Parent Product: EBook', 'authorpad' ),
		'all_items'           => __( 'All EBooks', 'authorpad' ),
		'view_item'           => __( 'View EBook', 'authorpad' ),
		'add_new_item'        => __( 'Add New Chapter', 'authorpad' ),
		'add_new'             => __( 'New EBook', 'authorpad' ),
		'edit_item'           => __( 'Edit EBook', 'authorpad' ),
		'update_item'         => __( 'Update EBook', 'authorpad' ),
		'search_items'        => __( 'Search ebooks', 'authorpad' ),
		'not_found'           => __( 'No ebooks found', 'authorpad' ),
		'not_found_in_trash'  => __( 'No ebooks found in Trash', 'authorpad' ),
	);
	$args = array(
		'label'               => __( 'ebooks', 'authorpad' ),
		'description'         => __( 'EBooks information pages', 'authorpad' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => true,
		'public'              => false,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => false,
		'menu_position'       => 10,
		'can_export'          => true,
		'has_archive'         => false,
		'exclude_from_search' => true,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'ebooks', $args );

}

// Hook into the 'init' action
add_action( 'init', 'ebook_post_type', 0 );