However, this button is not available in the default wordpress editor. Don't worry. In this section, the silver blog will bring everyone together to add a paging button to the article editor.
Add the following code to the function. php function template file of the topic:
The code is as follows: |
Copy code |
// Add the "next page" button in the WordPress editor Add_filter ('mce _ buttons ', 'wpdaxue _ add_next_page_button '); Function wpdaxue_add_next_page_button ($ 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; } |
In this way, the page button of the article is added, and an additional article page button will be displayed in the article editor (as shown in the figure below ). In the future, if the article is too long, you only need to insert this button in the area where you need to pagination to display it on pages.