王尘宇王尘宇

研究百度干SEO做推广变成一个被互联网搞的人

Typecho 主题模版制造经常使用挪用变量和函数,参数分享

Typecho 主题模版制造经常运用挪用变量和函数,参数分享


博主对Typecho博客程序情有独钟,然则还不会PHP所以四周网络Typecho制造模板的代码和函数什么的。
一个是轻易本身运用,别的一个轻易人人检察,又找到了点代码,本日发一下。

站点称号


<?php $this->options->title(); ?>

域名地点


<?php $this->options->siteUrl(); ?>

背景地点


<?php $this->options->adminUrl(); ?>

完全途径标题,比方 文章 站点


<?php $this->archiveTitle(' &raquo; ', '', ' - '); ?&gt;&lt;?php $this->options->title(); ?>

站点申明


<?php $this->options->description(); ?>

模版文件夹地点


<?php $this->options->themeUrl(); ?>

作者名字


<?php $this->author(); ?>

当前上岸用户名字


<?php $this->user->screenName(); ?>

退出链接


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>">

rss地点


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->options->feedUrl(); ?>

作者头像


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->author->gravatar('200') ?>

参数申明

此函数是完全 img 标签,200代表长和宽

该文作者悉数文章列表链接


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->author->permalink(); ?>

该文作者个人主页链接


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->author->url(); ?>

该文作者的邮箱地点


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->author->mail(); ?>

rss批评


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->options->commentsFeedUrl(); ?>

援用模版文件夹内php文件


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->need('*.php'); ?>

参数申明

能够运用相对途径猎取上级目次php文件

猎取最新post


options->logoutUrl(); ?>" target="_blank" _href="http://t.160.me/options->logoutUrl(); ?>"><?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=8&type=category')->parse('<li>{title}</li>'); ?>

纯文字分类称号,不带链接


<?php $this->category(',', false); ?>

猎取文章分类列表


  • <?php $this->widget('Widget_Metas_Category_List')                ->parse('

  • {name} ({count})

  • '); ?>

猎取某分类post


  • <?php $this->widget('[email protected]', 'pageSize=8&type=category', 'mid=1') ->parse('

  • {title}

  • '); ?>

猎取最新批评列表


      <?php $this->widget('Widget_Comments_Recent')->to($comments); ?>            <?php while($comments->next()): ?>permalink(); ?>"><?php $comments->author(false); ?>: excerpt(50, '...'); ?>首页猎取 最新文章 代码限定条数 (特别感谢蚂蚱)permalink(); ?>"><?php $comments->author(false); ?>: excerpt(50, '...'); ?>首页猎取 最新文章 代码限定条数 (特别感谢蚂蚱) <?php while ($this->next()): ?> <?php if ($this->sequence <= 3): ?> html <?php endif; ?> <?php endwhile; ?>

猎取最新批评列表第二个版本,只显现访客批评不显现博主也就是作者或者说本身发的批评


<?php $this->widget('Widget_Comments_Recent','ignoreAuthor=true')->to($comments); ?>    <?php while($comments->next()): ?>    <li>

相关文章

评论列表

发表评论:
验证码

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。