Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Offers Custom Post Type

originally used on red templates

// Register Custom Post Type
function create_offers_posttype() {

	$labels = array(
		'name'                => 'Offers',
		'singular_name'       => 'Offer',
		'menu_name'           => 'Offers',
		'name_admin_bar'      => 'Offers',
		'parent_item_colon'   => 'Parent Offer:',
		'all_items'           => 'All Offers',
		'add_new_item'        => 'Add New Offer',
		'add_new'             => 'Add Offer',
		'new_item'            => 'New Offer',
		'edit_item'           => 'Edit Offer',
		'update_item'         => 'Update Offer',
		'view_item'           => 'View Offer',
		'search_items'        => 'Search Offers',
		'not_found'           => 'Not found',
		'not_found_in_trash'  => 'Not found in Trash',
	);
	$args = array(
		'label'               => 'offers',
		'description'         => 'Offers custom post type',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'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'     => 'post',
	);
	register_post_type( 'offers', $args );

}

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