WordPress编辑器添加分页按钮的方法
wordpress编辑器中添加分页(nextpage)按钮方法,为WordPress编辑器添加可视化/HTML文章分页按钮三种方法,WordPress在编辑器中添加“下一页”分页按钮,如何给wordpress编辑器加入分页按钮功能,下面小编来给大家介绍一下,一起来了解一下吧!
WordPress正文具备分页功能,但在编辑器中却没有添加分页的按钮,我们可以通过下面的一段代码很容易添加一个分页按钮。
将以下代码添加到您的当前主题的 functions.php 文件:
add_filter('mce_buttons','wysiwyg_editor');
function wysiwyg_editor($mce_buttons) {
$pos = array_search('wp_more',$mce_buttons,true);
if ($pos !== false) {
$tmp_buttons = array_slice($mce_buttons, 0, $pos+1);
$tmp_buttons[] = 'wp_page';
$mce_buttons = array_merge($tmp_buttons, array_slice($mce_buttons, $pos+1));
}
return $mce_buttons;
}
以上就是WordPress编辑器添加分页按钮的方法的介绍,希望大家喜欢!
更多教程关注FF推源码网。