[WP]投稿や固定ページのタイトルや本文編集エリアを非表示にする方法
スポンサード
スポンサード
WordPress管理画面の投稿や固定ページの編集画面で、記事のタイトルの本文の入力フィールドを非表示にする方法のご紹介です。
投稿画面でタイトルや本文編集エリアを非表示
ご利用のテーマのfunctions.phpに以下のコードを追記します。1 2 3 4 5 | add_action( 'init' , 'my_remove_post_editor_support' ); function my_remove_post_editor_support() { remove_post_type_support( 'post', 'title' );//タイトル remove_post_type_support( 'post', 'editor' );//本文 } |
固定ページでタイトルや本文編集エリアを非表示
固定ページの場合、functions.phpに追記するコードは以下のようになります。1 2 3 4 5 | add_action( 'init' , 'my_remove_post_editor_support' ); function my_remove_post_editor_support() { remove_post_type_support( 'page', 'title' );//タイトル remove_post_type_support( 'page', 'editor' );//本文 } |
スポンサード
コメント