カスタム投稿個別ページ作らない
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にする
http://www.prontonet.mobi/php/wordpress/%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E6%8A%95%E7%A8%BF%E3%81%AE%E6%8A%95%E7%A8%BF%E5%80%8B%E5%88%A5%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E4%BD%9C%E3%82%89%E3%81%9B%E3%81%AA%E3%81%84/
タグ: WordPress