1. first in the topic functions. add the following code to php: functionpagenavi ($ before '', $ after'', $ p2) {if (is_singular () return; global $ wp_query, $ paged; $ max_p
1. first add the following code to the topic functions. php:
Function pagenavi ($ before = '', $ after ='', $ p = 2) {if (is_singular () return; global $ wp_query, $ paged; $ max_page = $ wp_query-> max_num_pages; if ($ max_page = 1) return; if (empty ($ paged) $ paged = 1; echo $ before.'
'; If ($ paged> 1) p_link ($ paged-1, 'Previous page ','? '); If ($ paged> $ p + 1) p_link (1, 'homepage'); for ($ I = $ paged-$ p; $ I <= $ paged + $ p; $ I ++) {if ($ I> 0 & $ I <= $ max_page) $ I = $ paged? Print"
- {$ I}
": P_link ($ I);} if ($ paged <$ max_page-$ p) p_link ($ max_page, 'Last page'); if ($ paged <$ max_page) p_link ($ paged + 1, 'next page ','? '); Echo'
'. $ After;} function p_link ($ I, $ title = '', $ linktype ='') {if ($ title = '') $ title = "Jump to page {$ I}"; if ($ linktype = '') {$ linktext = $ I;} else {$ linktext = $ linktype ;} echo"
{$ Linktext}";}
2. Then, at the corresponding location of the page, change the original paging navigation code to the following:
As follows: