如何给WordPress编辑器添加文章分页按钮?

2022年11月28日 发表评论
腾讯云3年/5年服务器:点击抢每日限量秒杀名额 阿里云服务器99元/年:速抢优惠名额
腾讯云双十一:点击速抢9999元代金券 阿里云双十一:点击速抢5580元满减券
腾讯云新客无门槛满减券:限量速抢 阿里云活动中心优惠券:点击速抢

如何给WordPress编辑器添加文章分页按钮?

如何给WordPress编辑器添加文章分页按钮?不知道为什么WordPress明明有文章分页功能,而编辑器却没有插入分页符的按钮,必须切换到文本模式输入才能插入分页。

1、可以通过下面的代码在编辑器上添加一个分页符按钮。

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

3、代码如下:

  1.     function mce_page_break($mce_buttons) {   
  2. $pos = array_search('wp_more', $mce_buttons, true);   
  3. if ($pos !== false) {   
  4. $buttons = array_slice($mce_buttons, 0, $pos + 1); $buttons[] = 'wp_page';   
  5. $mce_buttons = array_merge($buttons, array_slice($mce_buttons, $pos + 1)); }   
  6. return $mce_buttons; }    
  7. add_filter('mce_buttons', 'mce_page_break');  

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: