Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanDecode committed Jun 20, 2019
1 parent 9f98c84 commit 2fbb2ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function themeFields(Typecho_Widget_Helper_Layout $layout) {
$layout->addItem($posttype);
$banner = new Typecho_Widget_Helper_Form_Element_Text('banner', NULL, NULL, '文章主图', '输入图片URL,该图片会用于主页文章列表的显示。');
$layout->addItem($banner);
$bannerascover = new Typecho_Widget_Helper_Form_Element_Select('bannerascover',array('2'=>'主图作为标题背景', '1'=>'主图显示在标题上方', '0'=>''),'1','首页主图样式','主图作为标题背景时会添加暗色遮罩,但仍然建议仅对暗色的主图采用该方式展示。否则请选择「主图显示在标题上方」。');
$bannerascover = new Typecho_Widget_Helper_Form_Element_Select('bannerascover',array('2'=>'主图作为标题背景', '1'=>'主图显示在标题上方', '0'=>'不显示'),'1','首页主图样式','主图作为标题背景时会添加暗色遮罩,但仍然建议仅对暗色的主图采用该方式展示。否则请选择「主图显示在标题上方」。');
$layout->addItem($bannerascover);
$showfullcontent = new Typecho_Widget_Helper_Form_Element_Select('showfullcontent',array('0'=>'', '1'=>''),'0','在首页显示完整内容','是否在首页展示完整内容。适合比较短的文章。');
$layout->addItem($showfullcontent);
Expand Down
8 changes: 7 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
<section id="index-list">
<ul id="masonry">
<?php while($this->next()): ?>
<li class="masonry-item style-<?php echo $this->fields->bannerascover; ?>">
<li class="masonry-item style-<?php
if($this->fields->showfullcontent=='1' && $this->fields->bannerascover == '2') {
echo '1';
} else {
echo $this->fields->bannerascover;
}
?>">
<a href="<?php $this->permalink();?>">
<article class="yue" itemscope itemtype="http://schema.org/Article">
<?php if($this->fields->banner != ''): ?>
Expand Down

0 comments on commit 2fbb2ba

Please sign in to comment.