【WordPress】如何在編輯模式中插入 nextpage 的標籤按鈕 - 吉姆的電腦閣誌

吉姆的電腦閣誌

HTML5,Jquery,PHP,FreeBSD分享教學。電腦是用來節省時間及提升樂趣,不是用來把人綁住的。隨心而行,順著生命的脈動重新創造屬於自己的生活。

Breaking

Home Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

2013-12-01

【WordPress】如何在編輯模式中插入 nextpage 的標籤按鈕

WordPress的加強型編輯器(TinyMCE),自WordPress 3.1版本以後就被官方移除,自己把它加回來吧!
 找到theme目錄中目前使用的佈景主題名稱下的 funtions.php ,然後加入這段程式碼即可:
// --------------------------------------------------------------------------
// Start Add NextPage Button
// --------------------------------------------------------------------------
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;
}
// --------------------------------------------------------------------------
// End Add NextPage Button
// --------------------------------------------------------------------------

沒有留言:

Post Bottom Ad

Responsive Ads Here

Pages