When editing an article, switch to HTML input, and then enter the page where you want it
The code is as follows |
Copy Code |
<!--nextpage-->
|
Some topics just add <!--nextpage--> tag is not enough, but also need a theme to support paging function, if you add a page tag, but the theme is not paging, then your theme does not support paging, you need to add yourself.
Add method: Open the article template (generally the subject of the single.php) file, if not single.php file, you need to find the article template.
Find the following function
The code is as follows |
Copy Code |
<?php the_content ();?> |
Then add the code behind it
The code is as follows |
Copy Code |
<?php Wp_link_pages (' Before ' => ' <div class= ' page-link ' > '. __ (' page number '), ' after ' => ' </div> '); ?> |
Although paging is implemented but not very convenient, the code for paging labels needs to be entered manually each time
Process: 1, find Wp-includes/js/quicktags.js, find the following JavaScript code:
The code is as follows |
Copy Code |
Edbuttons[edbuttons.length]=new Edbutton ("Ed_more", "more", "<!–more–>", "", "T",-1);
|
After this code, add the following code:
The code is as follows |
Copy Code |
Edbuttons[edbuttons.length]=new Edbutton ("Ed_next", "page", "<!–nextpage–>", "", "P",-1);
|
2. Continue to find the following code in the Wp-includes/js/quicktags.js:
The code is as follows |
Copy Code |
J.buttons[j.buttons.length]=new Edbutton (A + "_more", "more", "<!–more–>", "", "T",-1);
|
Add the following code:
The code is as follows |
Copy Code |
J.buttons[j.buttons.length]=new Edbutton (A + "_next", "page", "<!–nextpage–>", "", "P",-1);
|
OK, this file can be saved.
3. Find Wp-includes/js/quicktags.dev.js, find the following code
The code is as follows |
Copy Code |
/* Edbuttons[edbuttons.length] = New Edbutton (' Ed_next ' , ' page ' , ' <!–nextpage–> ' ,” , ' P ' ,-1 ); */
|
Get rid of the note, and finally the following
The code is as follows |
Copy Code |
Edbuttons[edbuttons.length] = New Edbutton (' Ed_next ' , ' page ' , ' <!–nextpage–> ' ,” , ' P ' ,-1 );
|
4. Find wp-admin/includes/post.php and find the following code:
The code is as follows |
Copy Code |
' Link ', ' unlink ', ' Wp_more ',
|
To add code after it:
The code is as follows |
Copy Code |
' Wp_page ',
|
OK, when you open the editor to write the article, the visual state will appear in the page Break button, you want to insert the page number when you click this button on the line