Home > php教程 > php手册 > body text

wordpress评论分页代码

WBOY
Release: 2016-06-21 08:56:18
Original
1512 people have browsed it

如果博客评论多了,不实现分页效果真的很难翻页。百度找了下,这个方法还行。

如果博客评论多了,不实现分页效果真的很难翻页。百度找了下,这个方法还行。
1.找到wp-content\themes下面的comments.php文件。
2.把这段代码  // 如果用户在后台选择要显示评论分页
 if (get_option(‘page_comments’)) {
  // 获取评论分页的 HTML
  $comment_pages = paginate_comments_links(‘echo=0′);
  // 如果评论分页的 HTML 不为空, 显示导航式分页
  if ($comment_pages) {
?>




  }
 }
?>替换原来的




3.写一下样式,我是这么写的
.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;}
本文sky ( www.zzjs.net ) 原创编辑,请遵守行业规则,转载保留版权。



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template