1. Download/install
Download and install wordpress, and download the Baidu editor wp plug-in.
2. Install Baidu editor
2.1 decompress the package and copy the ueditor folder to wp-content/plugins.
2. Copy the general-template.php file under the ueditor file to the wp-topics des/folder, copy the original file, or change the source file first.
2. 3. Modify general-template.php
About 1790th lines of the file
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. Modify wp-content/plugins/ueditor/editor_config.js
Change
Var URL = window. location. protocol + "//" + window. location. hostname + "/wp-content/plugins/ueditor /";
// You can configure the relative path of the ueditor directory on your website.
3. Modify
Modify wp-admin.css under wp-admin/
Search # wp-word-count
# Wp-word-count {display: none; padding: 2px 10px ;}< strong> </strong>/* The number of words is counted, because the Baidu editor already has this function, none is dropped, but it is dispensable! */
4. Note
Currently, the official version only supports Wordpress V3.2.1. There are still many bugs and deficiencies in the new version of Wordpress, which are not recommended for Wordpress 3.2.1 or later versions. Therefore, Baidu editor is only for testing.