typecho获取分类页面的分类mid 在出题开发时,我们想通过设置为不同分类设置不同样式排版时,想使用mid参数进行配置,但好像没有什么直接的方法?不过可以通过这个获取当前页面缩略名$this->getArchiveSlug()的方法,来进行数据库查询查到分类mid.写查询函数函数如下,就是传递下当前slug然后查询分类表进而获取mid,标签页面也通用function remid($slug){ $db =...
Typecho 输出所有分类+文章-就像CMS一样 输出分类和文章,制作CMS模板必备 <?php $this->widget('Widget_Metas_Category_List')->to($categories); ?> <?php while ($categories->next()): ?> <?ph...
Typecho常用统计 一些常用统计<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?> 文章总数:<?php $stat->publishedPostsNum() ?>篇 分类总数:<?php $stat->categoriesNum() ?>个 评论总数:<?php $...
Typecho神奇的is语法 神奇的is语法typecho可以使用is语法判断很多东西,比如$this->is('index'); //判断首页 $this->is('archive'); //判断archive $this->is('single'); //判断为阅读页面page+post $this->is('page...