WordPress comes with TinyMCE editor using the full version of the skills

Since the use of WordPress since I do not know how many background editing, from FCKEditor to CKeditor, and even some of the little-known CodeRenderUnmi and WLW, FE editor, etc., used to find some features really strong, but It is necessary to modify a lot of things with easy, and once WordPress or plug-in itself to upgrade their own, those who have to modify the things that must be re-set again, quite trouble; or some offline editor, copy to paste to Very bother. Up to now, I still feel that, wordpress template comes with the editor is the most powerful and practical!
Is the so-called “since the intensive, gradually in the absence of sword wins the sword of the territory,” put aside those exaggerated editor, back to WordPress comes with TinyMCE editor up, you know, WordPress itself is constantly strong, Every time the upgrade on the built-in editor changes are very practical, not only the integration of multimedia functions together, and gives the feeling is more and more neat, since we can see the official on the editor TinyMCE Attention to the degree. Now I will own the editor TinyMCE own way to paste out, all the code only need to write to the theme of the functions.php file, even if the future upgrade WordPress also do not need to repeat the operation.
Change the editor default view to HTML
As we all know, in the background of the new article, the editor will automatically jump to the “visual” view, for some often insert the code or WEB designers (I was ^ _ ^), may be more accustomed to using HTML view manually edit. Also, like CKEditor editing in the visual view has no <p> or <div> tag, but will automatically add to the HTML view, of course, this is CKEditor automatic settings nothing wrong, but in the future want to re-edit a published When the article will be a headache, because CKEditor will be self-contained to generate a lot of complicated or confusing code, keep the code clean and tidy is very inconvenient (of course, you want to make do with the actual display will not have a great change, but Will reduce the structure of the page).
Set the method: Add the following code to the theme’s functions.php file:
add_filter (‘wp_default_editor’, create_function (”, ‘return’ html “; ‘));
Add editor default content (visible in editor)
After the new article editor editor content is empty by default, some friends do is wordpress theme station, plug-in station or a simple download station, some standard formatted article will enter the “theme name”, “theme author” , “Download address” and other content, add the default content, the repetitive work later no longer, and everything is pre-defined. And if the article does not need to publish these pre-defined content, only need all-Delete ok, and will not be very troublesome.
To set the method: Add the following code to the subject functions.php file:
function insertPreContent ($ content) {
if (! is_feed () &&! is_home ()) {
$ content. = “<div class = ‘wpohome’>”;
$ content. = “<h4> CMS concentration camp </ h4>”;
$ content. = “The predefined content here is visible in the editor <a href=’http://www.cmsjzy.cn’> CMS concentration camp </a>”;
$ content. = “</ div>”;
}
return $ content;
}
add_filter (‘default_content’, ‘insertPreContent’);
Add editor default content (not visible when editing)
The content added by this method is automatically added at the end of the content when the article is published, invisible at the time of editing, used to add subscriptions, article copyright information, and so on.
To set the method: Add the following code to the subject functions.php file:
function insertFootNote ($ content) {
if (! is_feed () &&! is_home ()) {
$ content. = “<div class = ‘wpohome’>”;
$ content. = “<h4> CMS concentration camp </ h4>”;
$ content. = “The predefined content here is visible in the editor <a href=’http://www.cmsjzy.cn’> CMS concentration camp </a>”;
$ content. = “</ div>”;
}
return $ content;
}
add_filter (‘the_content’, ‘insertFootNote’);
Add more HTML tags (with caution)
This feature should be used with caution, because WordPress comes with the TinyMCE editor will filter out the default does not meet the XHTML 1.0 html tags, such as “br /”, “iframe” and so on. But do not rule out the case may also use these labels, so the method for the reference for you.
Add method: Paste the following code into the theme’s functions.php file:
function fb_change_mce_options ($ initArray) {
$ ext = ‘pre [id | name | class | style], iframe [align | longdesc |
name | width | height | frameborder | scrolling | marginheight |
margin? | src] ‘; // Note: The format is “label one [attribute one | attribute two], label two [attribute one | attribute two | attribute three]
if (isset ($ initArray [‘extended_valid_elements’])) {
$ initArray [‘extended_valid_elements’]. = ‘,’. $ ext;
} else {
$ initArray [‘extended_valid_elements’] = $ ext;
}
return $ initArray;
}
add_filter (‘tiny_mce_before_init’, ‘fb_change_mce_options’);