Typecho 主题调用,标签或者函数

2014-01-13丨运维丨暂无评论 丨3588 次阅读

/*头部
<?php $this->keywords('_'); ?> //关键词
<?php $this->options->title(); ?> //站点名称
<?php $this->options->description(); ?> //站点描述
<?php $this->archiveTitle(); ?> //标题
<?php $this->options->themeUrl('ie.css'); ?> //模板路径
<?php $this->options->siteUrl(); ?> //主页网址
<?php $this->options->feedUrl(); ?>
<?php $this->options->commentsFeedUrl(); ?>
<?php $this->pageNav(); ?> //分页
<?php $this->options->generator(); ?> //版本号
/*文章
<?php $this->title(); ?> //标题
<?php $this->category(','); ?> //分类
<?php $this->tags(', ', true, ''); ?> //标签
<?php $this->date('F jS, Y') ?> //时间
<?php $this->content(); ?> //内容
<?php $this->thePrev('&laquo; %s', ''); ?> //上一篇
<?php $this->theNext('%s &raquo;', ''); ?> //下一篇

/*标签云
<?php $this->widget(‘Widget_Metas_Tag_Cloud’, ‘ignoreZeroCount=1&limit=20′)->to($tags); ?>
<?php while($tags->next()): ?>
<a href=”<?php $tags->permalink(); ?>”><?php $tags->name(); ?></a>
<?php endwhile; ?>

/*最新文章
<?php $this->widget(‘Widget_Contents_Post_Recent’)->to($post); ?>
<?php while($post->next()): ?>
<a href=”<?php $post->permalink(); ?>” title=”<?php $post->title(); ?>”>
<?php $post->title(25, ‘…’); ?></a>
<?php endwhile; ?>

/*相关内容
<?php $this->related(5)->to($relatedPosts); ?>
<?php while ($relatedPosts->next()): ?>
<a href=”<?php $relatedPosts->permalink(); ?>” title=”

<?php $relatedPosts->title(); ?>”><?php $relatedPosts->title(); ?></a>

<small><strong><?php $relatedPosts->author(); ?></strong> post in

<?php $this->date(‘Y-m-d H:i:s’); ?></small>
<?php endwhile; ?>

/*日期归档
<?php $this->widget(‘Widget_Contents_Post_Date’, ‘type=month&format=F Y’)
->parse(‘<li><a href=”{permalink}”>{date}</a> ({count})</li>’); ?>

/*友情链接
<?php PageToLinks::output(‘links’, ‘h3′, ‘ul’); ?>

标签: typecho

热门文章

最新回复

标签

发表新评论