Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

TRWD Custom Bid Post Type

if ( ! function_exists('bid_opportunity') ) {

// Register Custom Post Type
function bid_opportunity() {

	$labels = array(
		'name'                  => 'Bid Opportunities',
		'singular_name'         => 'Bid Opportunity',
		'menu_name'             => 'Bids',
		'name_admin_bar'        => 'Bid Opportunities',
		'archives'              => 'Bid Opps Archives',
		'parent_item_colon'     => 'Parent Bid Opportunity:',
		'all_items'             => 'All Bid Opportunities',
		'add_new_item'          => 'Add New Bid Opportunity',
		'add_new'               => 'Add New Bid Opportunity',
		'new_item'              => 'New Bid Opportunity',
		'edit_item'             => 'Edit Bid Opportunity',
		'update_item'           => 'Update Bid Opportunity',
		'view_item'             => 'View Bid Opportunity',
		'search_items'          => 'Search Bid Opportunities',
		'not_found'             => 'Bid Opportunity Not found',
		'not_found_in_trash'    => 'Bid Opportunity Not found in Trash',
		'featured_image'        => 'Bid Opportunity Featured Image',
		'set_featured_image'    => 'Set Bid Opportunity featured image',
		'remove_featured_image' => 'Remove Bid Opportunity featured image',
		'use_featured_image'    => 'Use as featured image for Bid Opportunity',
		'insert_into_item'      => 'Insert into Bid Opportunity',
		'uploaded_to_this_item' => 'Uploaded to this Bid Opportunity',
		'items_list'            => 'Bid Opportunities List',
		'items_list_navigation' => 'Bid Opportunity List Navigation',
		'filter_items_list'     => 'Filter Bid Opportunity List',
	);
	$args = array(
		'label'                 => 'Bid Opportunity',
		'description'           => 'Contracting Bid Opportunities',
		'labels'                => $labels,
		'supports'              => array( 'title', 'page-attributes', ),
		'taxonomies'            => array( 'bids' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 25,
		'menu_icon'             => 'dashicons-hammer',
		'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( 'bids', $args );

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

}