Custom post type uiを使わず、function.phpに記述してカスタム投稿を作成する場合。
以下は複数作る場合も含めて。
add_action( 'init', 'create_post_type' );
function create_post_type() {
// 一つ目
register_post_type( 'jirei01',
array(
'labels' => array(
'name' => __( '一般住宅事例' ),
'singular_name' => __( '一般住宅事例' )
),
'public' => true,
'has_archive' => true,
'menu_position' => 5,
)
);
// 二つ目
register_post_type( 'jirei02',
array(
'labels' => array(
'name' => __( '事務所店舗事例' ),
'singular_name' => __( '事務所店舗事例' )
),
'public' => true,
'has_archive' => true,
'menu_position' => 5,
)
);
}