分享学习记录
互联网技术知识

WordPress编辑器添加文章分页按钮的方法

不知道为什么Wordpress明明有文章分页功能,而编辑器却没有插入分页符的按钮,必须切换到文本模式输入才能插入分页。可以通过下面的代码在编辑器上添加一个分页符按钮。

将下面的代码添加到当前主题functions.php即可。

function mce_page_break($mce_buttons) {
$pos = array_search('wp_more', $mce_buttons, true);
if ($pos !== false) {
$buttons = array_slice($mce_buttons, 0, $pos + 1);
$buttons[] = 'wp_page';
$mce_buttons = array_merge($buttons, array_slice($mce_buttons, $pos + 1));
}
return $mce_buttons;
}
add_filter('mce_buttons', 'mce_page_break');
赞(0)
文章名称:《WordPress编辑器添加文章分页按钮的方法》
文章链接:https://www.bailuze.com/18435.html
本站所有文章,如无特殊说明或标注,均为本站原创发布。任何在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
本站专注于百度、搜狗、360、谷歌、bing等常见搜索引擎的优化,关键词排名的提高,诚意咨询邮箱526009505@qq.com
分享到