カスタム投稿でのパーマリンクを変更
-
カスタム投稿ですとパーマリンクはデフォルトで、
http://ドメイン/スラッグ/投稿名になるかと思います。
このアドレスを
http://ドメイン/投稿名
にしたいのですがいい方法があればご教授お願いします。
Custom Post Type Permalinksを使いfunctions.phpに以下のように
register_post_type( ‘career_voice’, array(
‘label’ => ‘ラベル名’,
‘public’ => true,
‘query_var’ => true,
‘capability_type’ => ‘post’,
‘hierarchical’ => true,
‘rewrite’ => false,
‘menu_position’ => 5,
‘supports’ => array(
‘title’,
‘editor’,
‘thumbnail’,
‘custom-fields’, ‘excerpt’,
‘revisions’,
‘page-attributes’
),
‘has_archive’ => true,
‘with_front’ => false
));設定すると、
http://ドメイン/?career_voice=投稿名、になります。
そもそもカスタム投稿ではhttp://ドメイン/投稿名、は出来ないのでしょうか?
よろしくお願いします。
- トピック「カスタム投稿でのパーマリンクを変更」には新たに返信することはできません。