使用WordPress程序的朋友都知道WordPress自带的文章分页功能是比较单一的,样式也丑,WordPress主题站就想着能自定义分页导航吗?今天就为大家分享一个WordPress上一页下一页自定义数字分页导航代码教程。

最终效果图如下:

要实现上图中的上一页下一页数字文章分页导航WordPress教程有很多种方法,相关的WordPress插件有很多, 不过能少用插件就少用,下面贴出功能代码,供大家参考

function yg_fenye(){

$args = array(

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’prev_next\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => 0,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’format\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’?paged=%#%\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’before_page_number\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’mid_size\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => 2,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’current\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => max( 1, get_query_var(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’paged\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’) ),

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’prev_next\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => True,

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’prev_text\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => __(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’上一页\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’),

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’next_text\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ => __(\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’下一页\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’),

);

$page_arr=paginate_links($args);

if ($page_arr) {

echo $page_arr;

}else{

}

}

相关新闻

发表评论

您的电子邮箱地址不会被公开。

联系我们

联系我们

151-1101-0018

在线咨询:
邮件:30115776@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
关注微信
分享本页
返回顶部