
#記事編集画面のスタイル設定で、独自のスタイルを登録する方法
function.php
| 
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  | 
$style_formats = array(     array(         'title' => '注意事項',         'block' => 'div',         'classes' => 'chui',         'wrapper' => true,//段落ごとに設定しないでまるごとスタイル適用している。     ),     array(         'title' => '重要',         'block' => 'div',         'classes' => 'juyou',         'wrapper' => true,     ),     array(         'title' => 'ハイライト',         'inline' => 'span',         'classes' => 'hightlight',     ), );  | 
| 
 1 2  | 
$init['style_formats']=json_encode($style_formats);  | 
//スタイルメニューを追加する
| 
 1 2 3 4 5 6  | 
function add_stylemenu($buttons){     array_splice($buttons, 1, 0, 'styleselect');     return $buttons; } add_filter('mce_buttons_2','add_stylemenu');  | 
スポンサードリンク
編集画面でも、スタイルシートを適用する
function.phpに以下を書き込む
| 
 1  | 
add_editor_style();  | 
テーマフォルダにeditor-style.cssを追加する。 editor-style.cssに、表示用CSSをコピペする。
本文が長い場合に分割する
コード追加
編集画面にて
| 
 1  | 
<!--nextpage-->  | 
を追加する。
ページネーションの追加
single.phpの編集エリア最後の方に
 <?php wp_link_pages(); ?>
を追加する。
アイキャッチを最初のページのみにする
 <?php if(has_post_thumbnail()): ?>
↓
 <?php if(has_post_thumbnail() && $page==1): ?>