Typecho自定义字段缩略图的方法
Typecho在主题模板functions.php里面添加下面代码,就会发现在Typecho后台撰写新文章时候下面自定义字段就会有相关的输入框了。
在主题里面添加函数
function themeFields($layout) {
$thumbmine = new Typecho_Widget_Helper_Form_Element_Text('thumbmine', NULL, NULL, _t('自定义缩略图'), _t('.png或.jpg'));
$layout->addItem($thumbmine);
}
引用Typecho文章自定义字段
<?php $this->fields->thumbmine();?>
版权声明:本文由 鹿泽笔记 原创发布。
本文链接:https://www.bailuze.com/19843.html
许可协议:本文标题《Typecho自定义字段缩略图的方法》,转载请注明文章出处及原始链接。
