恢复WordPress 2.6的Tinymce编辑器的图片和分页按钮
In: CMS
20
七
2008
今天升级到了wordpress 2.6,在编辑文章的时候,原来tinymce编辑器的图片插入和分页按钮不见了,其实它们只是被隐藏了,如何将它们重现。在网上搜索了一下,在WordPress中文站找到了答案,如下:
1. 大家可以修改wp安装目录下的\wp-includes\js\tinymce/tiny_mce_config.php把它恢复。在121行,找到:
- $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more','|', 'spellchecker', 'fullscreen', 'wp_adv' ));
- $mce_buttons = implode($mce_buttons, ',');
然后将其替换为:
- $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', 'wp_page','|', 'spellchecker', 'fullscreen', 'wp_adv' ));
- $mce_buttons = implode($mce_buttons, ',');
这样可视化编辑器中就出现了image和nextpage的输入按钮了。
2. 这时,html编辑器下的“文章分页”也依旧被隐藏着,我们编辑wp-includes\js/quicktags.js把它恢复。在143行,找到:
- /*
- edButtons[edButtons.length] =
- new edButton(’ed_next’
- ,’page’
- ,’< !–nextpage–>’
- ,”
- ,’p’
- ,-1
- );
- */
将“/*”和“*/”注释符去除。
3. 最后,最后请在文章页模板(通常为single.php)的loop中添加下列代码
- < ?php wp_link_pages(); ?>
来实现文章内分页链接的输出。
PS: 有的模板已经有了这个调用语句,因此就不再需要添加这个句段了。