Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

OISS – Homepage Information Section

if ( ! function_exists('hp_info_section') ) {

// Register Custom Post Type
function hp_info_section() {

	$labels = array(
		'name'                => _x( 'Information Sections', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'Information Section', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'Homepage Information Section', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent Information Section:', 'text_domain' ),
		'all_items'           => __( 'All Information Sections', 'text_domain' ),
		'view_item'           => __( 'View Information Section', 'text_domain' ),
		'add_new_item'        => __( 'Add New Information Section', 'text_domain' ),
		'add_new'             => __( 'Add New', 'text_domain' ),
		'edit_item'           => __( 'Edit Information Section', 'text_domain' ),
		'update_item'         => __( 'Update Information Section', 'text_domain' ),
		'search_items'        => __( 'Search Information Sections', 'text_domain' ),
		'not_found'           => __( 'Not found', 'text_domain' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
	);
	$rewrite = array(
		'slug'                => '',
		'with_front'          => false,
		'pages'               => false,
		'feeds'               => false,
	);
	$capabilities = array(
		'edit_post'           => 'edit_post',
		'read_post'           => 'read_post',
		'delete_post'         => 'delete_post',
		'edit_posts'          => 'edit_posts',
		'edit_others_posts'   => 'edit_others_posts',
		'publish_posts'       => 'publish_posts',
		'read_private_posts'  => 'read_private_posts',
	);
	$args = array(
		'label'               => __( 'hp_info_section', 'text_domain' ),
		'description'         => __( 'Homepage Information Secions', 'text_domain' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'thumbnail', ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => false,
		'show_in_admin_bar'   => false,
		'menu_position'       => 5,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capabilities'        => $capabilities,
	);
	register_post_type( 'hp_info_section', $args );

}

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

}