オートフォーマットの変更
参照:http://setting-tool.net/wordpress-p-br-auto-format
これも初期インストール時にやってしまったほうがいい変更。
functions.phpに以下のコードを追加する。
// オートフォーマット関連の無効化 function my_init_func() { remove_filter('the_title', 'wptexturize'); remove_filter('the_content', 'wptexturize'); remove_filter('the_excerpt', 'wptexturize'); remove_filter('the_title', 'wpautop'); remove_filter('the_content', 'wpautop'); remove_filter('the_excerpt', 'wpautop'); remove_filter('the_editor_content', 'wp_richedit_pre'); } add_action('init', 'my_init_func'); // オートフォーマット関連の無効化 TinyMCE function my_tinymce_mceInit($init) { $init['wpautop'] = false; $init['apply_source_formatting'] = ture; return $init; } add_filter('tiny_mce_before_init','my_tinymce_mceInit');
ビジュアルモードとテキストモードを切り替えても、Pタグや改行が崩れない。素敵!