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: // The functionpar_pagenavi ($ range4) {global $ paged, $ wp_query; if (! $ Too many max_pa plug-ins are always bad. based on 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:
// 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
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.