首页 > 数据治理 > 数据治理 > Typecho博客程序代码分享-花样分页代码
想让你的Typecho博客页面看起来与众不同,那么你需要学会下面几招页面分页招式,笔者的几个个人博客都是使用Typecho建站程序搭建的,在建站过程中,摸索了几套页面分页的小技巧,在这里分享给有需要的朋友。 <?php if($this->_currentPage>1): ?><?php endif; ?> <?php if($this->_currentPage<$this->getTotal() / $this->parameter->pageSize): ?><?php endif; ?>
分页代码:
<?php $this->pageNav('Newer', 'Older', 1, '...', array('wrapTag' => 'nav', 'wrapClass' => 'page-nav', 'itemTag' => '', 'prevClass' => 'extend prev', 'nextClass' => 'extend next', 'currentClass' => 'page-number current' )); ?>
个性代码A:
<nav class="blog-nav">
<ul class="pagination">
<li>
<?php $this->pageLink('<x aria-label="Previous"><span aria-hidden="true">上一页</span></x>'); ?>
</li>
<li><span class="nav_pagenum"><?php if($this->_currentPage>1) echo $this->_currentPage; else echo 1;?> / <?php echo ceil($this->getTotal() / $this->parameter->pageSize); ?></span></li>
<li>
<?php $this->pageLink('<x aria-label="Next"><span aria-hidden="true">下一页</span></x>','next'); ?>
</li>
</ul>
</nav>
<?php $this->pageLink('Previous'); ?>
<span class="page-number"><?php if($this->_currentPage>0) echo 'Page '.$this->_currentPage.' of '; ?><?php echo ceil($this->getTotal() / $this->parameter->pageSize); ?></span>
<?php $this->pageLink('Next','next'); ?>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31380193/viewspace-2683464/ ,如需转载,请注明出处,否则将追究法律责任。