Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Microsite

if ( ! function_exists('microsite_post_type') ) {

// Register Custom Post Type
function microsite_post_type() {

	$labels = array(
		'name'                  => _x( 'Microsites', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Microsite', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Microsites', 'text_domain' ),
		'name_admin_bar'        => __( 'Microsite', 'text_domain' ),
		'archives'              => __( 'Microsite Overzicht', 'text_domain' ),
		'attributes'            => __( 'Microsite Attributes', 'text_domain' ),
		'parent_item_colon'     => __( 'Parent Product:', 'text_domain' ),
		'all_items'             => __( 'Alle Microsites', 'text_domain' ),
		'add_new_item'          => __( 'Add New Microsite', 'text_domain' ),
		'add_new'               => __( 'Nieuwe Microsite', 'text_domain' ),
		'new_item'              => __( 'New Microsite', 'text_domain' ),
		'edit_item'             => __( 'Edit Microsite', 'text_domain' ),
		'update_item'           => __( 'Update Microsite', 'text_domain' ),
		'view_item'             => __( 'Preview Microsite', 'text_domain' ),
		'view_items'            => __( 'View Microsites', 'text_domain' ),
		'search_items'          => __( 'Search Microsite', 'text_domain' ),
		'not_found'             => __( 'No products found', 'text_domain' ),
		'not_found_in_trash'    => __( 'No microsites geonden in de Trash', 'text_domain' ),
		'featured_image'        => __( 'Hoofdfoto', 'text_domain' ),
		'set_featured_image'    => __( 'Set hoofdfoto', 'text_domain' ),
		'remove_featured_image' => __( 'Verrwijder hoofdfoto', 'text_domain' ),
		'use_featured_image'    => __( 'Gebruik als hoofdfoto', 'text_domain' ),
		'insert_into_item'      => __( 'Insert into Microsite', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Uploaded to this Microsite', 'text_domain' ),
		'items_list'            => __( 'Microsite lijst', 'text_domain' ),
		'items_list_navigation' => __( 'Microsites navigatie', 'text_domain' ),
		'filter_items_list'     => __( 'Filter lijst', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Microsite', 'text_domain' ),
		'description'           => __( 'Woning informatie microsites', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'revisions', 'custom-fields', ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-laptop',
		'show_in_admin_bar'     => false,
		'show_in_nav_menus'     => false,
		'can_export'            => true,
		'has_archive'           => 'microsites',
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capability_type'       => 'page',
	);
	register_post_type( 'microsite', $args );

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

}