Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

custom post type news

// Register Custom Post Type
function ytbd_custom_post_type_news() {

	$labels = array(
		'name'                => _x( 'news', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'news', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'お知らせ', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),
		'all_items'           => __( '全てのお知らせ', 'text_domain' ),
		'view_item'           => __( 'お知らせを見る', 'text_domain' ),
		'add_new_item'        => __( 'お知らせを新規追加', 'text_domain' ),
		'add_new'             => __( 'お知らせを新規追加', 'text_domain' ),
		'edit_item'           => __( 'お知らせを編集', 'text_domain' ),
		'update_item'         => __( 'お知らせを更新', 'text_domain' ),
		'search_items'        => __( 'お知らせを検索', 'text_domain' ),
		'not_found'           => __( '見つかりません', 'text_domain' ),
		'not_found_in_trash'  => __( 'ゴミ箱にはみつかりませんでした', 'text_domain' ),
	);
	$args = array(
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'post',
	);
	register_post_type( 'post_type', $args );

}

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