Add pagination in the wordpress blog editor

Source: Internet
Author: User
Tags wordpress blog

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.