Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Think Digital Projects Post Type

if ( ! function_exists('td_projects') ) {

// Register Custom Post Type
function td_projects() {

	$labels = array(
		'name'                  => _x( 'Projects', 'Post Type General Name', 'think_digital' ),
		'singular_name'         => _x( 'Project', 'Post Type Singular Name', 'think_digital' ),
		'menu_name'             => __( 'Projects', 'think_digital' ),
		'name_admin_bar'        => __( 'Project', 'think_digital' ),
		'archives'              => __( 'Project Archives', 'think_digital' ),
		'attributes'            => __( 'Project Attributes', 'think_digital' ),
		'parent_item_colon'     => __( 'Parent Project :', 'think_digital' ),
		'all_items'             => __( 'All Projects', 'think_digital' ),
		'add_new_item'          => __( 'Add New Project', 'think_digital' ),
		'add_new'               => __( 'Add New Project', 'think_digital' ),
		'new_item'              => __( 'New Project', 'think_digital' ),
		'edit_item'             => __( 'Edit Project', 'think_digital' ),
		'update_item'           => __( 'Update Project', 'think_digital' ),
		'view_item'             => __( 'View Project', 'think_digital' ),
		'view_items'            => __( 'View Projects', 'think_digital' ),
		'search_items'          => __( 'Search Project', 'think_digital' ),
		'not_found'             => __( 'Not found', 'think_digital' ),
		'not_found_in_trash'    => __( 'Not found in Trash', 'think_digital' ),
		'featured_image'        => __( 'Featured Image', 'think_digital' ),
		'set_featured_image'    => __( 'Set featured image', 'think_digital' ),
		'remove_featured_image' => __( 'Remove featured image', 'think_digital' ),
		'use_featured_image'    => __( 'Use as featured image', 'think_digital' ),
		'insert_into_item'      => __( 'Insert into Project', 'think_digital' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Project', 'think_digital' ),
		'items_list'            => __( 'Projects list', 'think_digital' ),
		'items_list_navigation' => __( 'Projects list navigation', 'think_digital' ),
		'filter_items_list'     => __( 'Filter Projects list', 'think_digital' ),
	);
	$args = array(
		'label'                 => __( 'Project', 'think_digital' ),
		'description'           => __( 'Project Listing for Think Digital', 'think_digital' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'revisions' ),
		'taxonomies'            => array( 'td_project_category' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-media-interactive',
		'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',
		'show_in_rest'          => true,
	);
	register_post_type( 'td_projects', $args );

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

}