导航菜单不显示某分类或某页面 <?php while ($pages->next()): ?> <?php while ($pages->next()): ?> //循环语句开始 <?php if ($pages->slug != 'about'): ?> // 记得闭合 if 语句 <?php if (($pages->slug ...
首页第一篇文章显示不一样 <?php if (($this->_currentPage == 1) && ($this->sequence == 1)): ?> ... //首页第一篇文章 <?php else: ?> ... //其它文章 <?php endif; ?>
例如24小时内发布的贴,需要一个标志来完成。这里是用判断输入特殊字符,再用CSS判断完成的。此代码由羽飞儿老师编写,案例可参考:www.vpsmm.com function timeZone($from){ $now = new Typech...
<?php while($this->next()): ?> <?php if($this->category != "cateslug"): ?> //正常输出循环 <?php endif; ?> <?php endwhile; ?>
<?php if($this->category == "help"): ?> //当前分类为help缩略图,则输出内容。 <?php endif; ?>可应用于自定义分类,或者,判断某些分类输出不同CSS。
判断是否为首页,输出相关内容:<?php if($this->is('index')): ?> //首页输出内容 <?php else: ?> //不是首页输出内容 <?php endif; ?>判断当前分类,输出内容:
判断为当前页的第几篇文章,并单独输出代码,可应用于第一篇文章底部广告:<?php if ($this->sequence == 0): ?> //需要的插入 <?php endif; ?>