Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Drinks

Beverages of all types

if ( ! function_exists('drinks') ) {

// Register Custom Post Type
function drinks() {

	$labels = array(
		'name'                => _x( 'drinks', 'Post Type General Name', 'azeitona' ),
		'singular_name'       => _x( 'drink', 'Post Type Singular Name', 'azeitona' ),
		'menu_name'           => __( 'Drinks', 'azeitona' ),
		'name_admin_bar'      => __( 'Drink', 'azeitona' ),
		'parent_item_colon'   => __( 'Parent Drink:', 'azeitona' ),
		'all_items'           => __( 'All Drinks', 'azeitona' ),
		'add_new_item'        => __( 'Add New Drink', 'azeitona' ),
		'add_new'             => __( 'Add New', 'azeitona' ),
		'new_item'            => __( 'New Drink', 'azeitona' ),
		'edit_item'           => __( 'Edit Drink', 'azeitona' ),
		'update_item'         => __( 'Update Drink', 'azeitona' ),
		'view_item'           => __( 'View Drink', 'azeitona' ),
		'search_items'        => __( 'Search Drinks', 'azeitona' ),
		'not_found'           => __( 'Drink Not found', 'azeitona' ),
		'not_found_in_trash'  => __( 'Drink Not found in Trash', 'azeitona' ),
	);
	$rewrite = array(
		'slug'                => 'drink',
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'drink', 'azeitona' ),
		'description'         => __( 'Beverages of all kinds', 'azeitona' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', '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'           => 'http://local.azeitona.noip.me/wp-content/themes/azeitona/library/images/icon-drinks.png',
		'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( 'drinks', $args );

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

}