CKEditorのインストール
footer.phpの
footer.php
<?php wp_footer(); ?>
</body>
</html>
の前に以下を入れる。cdn便利!
footer.php
<script src="https://cdn.ckeditor.com/4.9.0/standard/ckeditor.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>
/js/ckeditor_setting.js"></script>
CKEditorの設定
テーマフォルダにjsフォルダがあったのでそこに
ckeditor_setting.js
を作った。
ckeditor_setting.js
CKEDITOR.replace('editor1',{
// uiColor: '#fff',
height: 400,
scayt_autoStartup: false,
toolbarLocation: 'bottom',
forcePasteAsPlainText: true,
fillEmptyBlocks: false,
tabSpaces: 0,
// toolbar: [
// ['Image'],
// ],
});
中身はこんな感じ。
ckfinderのインストール
https://ckeditor.com/ckeditor-4/ckfinder/
ここからckfinderをダウンロードし、
先ほどのjsフォルダにインストール(コピペ)。
現状の安定版はv4.9.0のようです。
config.phpを編集する。
v4.9.0の場合は、
config.php
29行目
return false;
を true
に
69行目
'baseUrl' => '/ckfinder/userfiles/';
を、WordPressに入れるので
'baseUrl' => bloginfo($url).'/wp-content/uploads/chatmb/',
とする。
↑ ってので動くと思ったら動かない!!(´;ω;`)