标签 "判断语句" 下的文章

共找到 7 篇文章

导航不显示某分类或页面

· 1 分钟阅读
导航菜单不显示某分类或某页面 <?php while ($pages->next()): ?> <?php while ($pages->next()): ?> //循环语句开始 <?php if ($pages->slug != 'about'): ?> // 记得闭合 if 语句 <?php if (($pages->slug ...

首页第一篇文章显示不一样

· 1 分钟阅读
首页第一篇文章显示不一样 <?php if (($this->_currentPage == 1) && ($this->sequence == 1)): ?> ... //首页第一篇文章 <?php else: ?> ... //其它文章 <?php endif; ?>

显示最新贴子图标

· 2 分钟阅读
例如24小时内发布的贴,需要一个标志来完成。这里是用判断输入特殊字符,再用CSS判断完成的。此代码由羽飞儿老师编写,案例可参考:www.vpsmm.com function timeZone($from){ $now = new Typech...

判断当前分类并自定义内容

· 1 分钟阅读
<?php if($this->category == "help"): ?> //当前分类为help缩略图,则输出内容。 <?php endif; ?>可应用于自定义分类,或者,判断某些分类输出不同CSS。

判断是否为首页并自定义输出内容

· 1 分钟阅读
判断是否为首页,输出相关内容:<?php if($this->is('index')): ?> //首页输出内容 <?php else: ?> //不是首页输出内容 <?php endif; ?>判断当前分类,输出内容:

判断文章数量插入代码

· 1 分钟阅读
判断为当前页的第几篇文章,并单独输出代码,可应用于第一篇文章底部广告:<?php if ($this->sequence == 0): ?> //需要的插入 <?php endif; ?>