如何为wordpress 的文章添加分页
原文参考:http://www.wpdaxue.com/add-next-page-button-wordpress-post-editor.html
1、在编辑文章时切到text 模式,然后加上<!--nextpage-->
2、每次都要手动添加分页代码 <!--nextpage-->是一件非常费力的事,其实,我们只要在当前主题的 functions.php 添加下面的代码,就可以显示“下一页”按钮啦:
如果你是 WP 4.2 或以上的版本,可以使用下面的代码:
flymood: function.php 在 wp-content/themes/thwentythirteen(你的主题) 下面
-
/*-----------------------------------------------------------------------------------*/ -
# 在 WordPress 编辑器添加“下一页”按钮 -
# http://www.wpdaxue.com/add-next-page-button-wordpress-post-editor.html -
/*-----------------------------------------------------------------------------------*/ -
add_filter( 'mce_buttons', 'cmp_add_page_break_button', 1, 2 ); -
function cmp_add_page_break_button( $buttons, $id ){ -
if ( 'content' != $id ) -
return $buttons; -
array_splice( $buttons, 13, 0, 'wp_page' ); -
return $buttons; -
}
效果如下:


浙公网安备 33010602011771号