1、下載/安裝
下載並安裝wordpress,下載百度編輯器wp外掛程式.
2、安裝百度編輯器
2.1解壓之後, 把ueditor檔案夾複製到wp-content/plugins/下面.
2.2.複製ueditor檔案下的 general-template.php 檔案到wp-includes/檔案夾下面,複製原檔案, 或者先把源檔案改名.
2.3.修改 general-template.php
大約在檔案的第1790行左右
function wp_editor($content, $id = 'content')
{
echo '<textarea class="wp-editor-area" rows="20" tabindex="1" cols="40"
name="content" id="content" style="display: none; " aria-hidden="true">'.$content.'</textarea>';
echo '<script type="text/javascript" src="../wp-content/plugins/ueditor/editor_config.js"></script>';
echo '<script type="text/javascript" src="../wp-content/plugins/ueditor/editor-all.js"></script>';
echo '<link rel="stylesheet" type="text/css" href="../wp-content/plugins/ueditor/themes/default/ueditor.css"/>';
echo "<script type='text/javascript'>
var editor = new baidu.editor.ui.Editor(
{
initialContent:document.getElementById('content').value,
textarea:'content'
});
editor.render('content')
</script>";
}
2.4.修改 wp-content/plugins/ueditor/editor_config.js
在開始的地方修改為
var URL=window.location.protocol+"//"+window.location.hostname+"/wp-content/plugins/ueditor/";
//這裡你可以配置成ueditor目錄在您網站的相對路徑
3、修飾
修改wp-admin/下面的wp-admin.css
尋找#wp-word-count
#wp-word-count{display:none;padding:2px 10px;}<strong> </strong>/*這個是統計字數的,因為百度編輯器已經有了這個功能, 所以none掉, 不過可有可無!*/
4、注意
目前官方提供的版本只支援 V3.2.1 版本的Wordpress, 對於新版的Wordpress 還存在很多BUG和不足, 不建議用在3.2.1以上版本的Wordpress.因此百度編輯器僅供測試