Wordpress plug-in-free for pagination of articles. Too many plug-ins are always bad. in line with the principle that you don't need them, you can find them online. this method is feasible. 1. open the functions. php file under wp-uplodes and insert this code: too many plug-ins are always bad. in line with the principle that you don't need it, you can find it online. this method is feasible.
1. open the functions. php file under wp-uplodes and insert this code:
// Page-based plug-in-free self-added
Function par_pagenavi ($ range = 4 ){
Global $ paged, $ wp_query;
If (! $ Max_page) {$ max_page = $ wp_query-> max_num_pages;} if ($ max_page> 1) {if (! $ Paged) {$ paged = 1;} if ($ paged! = 1) {echo "back to home";} previus_posts_link ('previous page ');
If ($ max_page> $ range) {if ($ paged <$ range) {for ($ I = 1; $ I <= ($ range + 1 ); $ I ++) {echo "if ($ I = $ paged) echo" class = 'current' "; echo"> $ I ";}} elseif ($ paged >=( $ max_page-ceil ($ range/2) {for ($ I = $ max_page-$ range;
$ I <= $ max_page; $ I ++) {echo "if ($ I = $ paged) echo" class = 'stream '"; echo "> $ I" ;}} elseif ($ paged >=$ range & $ paged <($ max_page-ceil ($ range/2 )))) {for ($ I = ($ paged-ceil ($ range/2 ));
$ I <= ($ paged + ceil ($ range/2); $ I ++) {echo "if ($ I = $ paged) echo "class = 'current'"; echo "> $ I" ;}} else {for ($ I = 1;
$ I <= $ max_page; $ I ++) {echo "if ($ I = $ paged) echo" class = 'stream '"; echo "> $ I" ;}} next_posts_link ('next page ');
If ($ paged! = $ Max_page) {echo "Last Page ";}}}
2. locate index in the topic directory. php, search. php, archive. php files have different themes, but the names are not necessarily the same. you just need to find the home page, search for pages, flip the pages, and then add
To the original paging code, that is, to replace this paging code
3.parse sample code to style.css.
. Page_navi {width: 100%; height: 36px; line-height: 36px; text-align: center; overflow: hidden; padding-top: 1em ;}
. Page_navi a {padding: 3px 8px; margin: 2px; text-decoration: none; color: #888; border: 1px solid # ccf ;}
. Page_navi a: hover,. page_navi a. current {border: 1px solid #356aa0; color: #356aa0; font-weight: bolder ;}
Bytes. 1. open the functions. php file under wp-uplodes and insert this code: // points...