カスタム投稿個別ページ作らない

この記事は約2分で読めます。
スポンサーリンク
add_action( 'init', 'create_post_type' );
function create_post_type() {
 
 register_post_type( 'custom_post',
 array(
 'labels' => array(
 'name' => __( 'カスタム投稿' ),
 'singular_name' => __( 'カスタム投稿' )
 ),
 'public' => false,
 'show_ui' => true,
 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields' ,'comments' ),
 'menu_position' =>5,
 'has_archive' => true
 )
 );
 
}

publicをfalseに
show_uiをtrueにする


カスタム投稿の投稿個別ページを作らせない | CODE:コード - Webサイト制作で使える、コーディングテクニックを紹介
Webサイト制作で使える、コーディングテクニックを紹介

コメント

タイトルとURLをコピーしました