心水别人的Mirages主题,可是收费啊,虽然50元并不贵,但是本着能不花钱就不花钱的原则,我决定升级(gao fang)一下样式。
(是不是很简洁好看,那个丑丑的热门文章侧边栏请忽略,没高兴美化 已美化)
1.编写css样式文件,放到主题的/assets/css/dzhCustom.css下
.articalSite {
transform: translate(-50%,-50%);
position: absolute;
top: 50%;
left: 50%;
z-index: 10;
text-align: center;
border-radius: .5rem;
width: 100%;
padding: 30px 10px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.articalTitle {
color:#fff;
text-shadow: 0 0 5px #c3c3c3;
font-weight: 400;
text-align: center;
margin-top: 5px;
margin-bottom: .75rem;
font-size: 1.5625rem
}
.articalDescription {
color:#eee;
text-shadow: 0 0 5px #c3c3c3;
font-weight: 400;
text-align: center;
margin-top: 5px;
margin-bottom: .75rem;
font-size:.875rem
}
2.再header.php中添加引用
<link href="<?php $this->options->themeUrl('assets/css/dzhCustom.css'); ?>" rel="stylesheet">
3.修改index.php和archive.php文件
替换掉整段article标签即可
<article itemscope itemtype="http://schema.org/BlogPosting" class="card animated wow fadeIn" data-wow-duration="1s" data-wow-offset="10" style='padding:0px ;margin:40px auto;'>
<a href="<?php $this->permalink(); ?>">
<div>
<?php $this->sticky(); ?>
<?php if (Utils::isEnabled('enableLazyload', 'AriaConfig')) : ?>
<div class="card-thumbnail lazyload" data-original=<?php if ($this->fields->thumbnail)
$this->fields->thumbnail();
else
echo Utils::getThumbnail();
?> style="background:url(<?php $this->options->themeUrl('assets/img/loading.svg') ?>) center center no-repeat;background-size: 100% auto;border-radius :10px;">
</div>
<?php else : ?>
<div class="card-thumbnail" style="background:url(<?php if ($this->fields->thumbnail)
$this->fields->thumbnail();
else
echo Utils::getThumbnail();
?>) center center no-repeat;background-size: 100% auto;border-radius :10px;">
</div>
<?php endif; ?>
<div class="articalSite">
<a class='articalTitle' href="<?php $this->permalink(); ?>"><?php $this->title(); ?></a>
<div class='articalDescription'>
<span> <?php $this->date(); ?>・</span><span><?php $this->category('・', false, '无'); ?>・</span>
<span><i class="iconfont icon-aria-comment"></i> <?php $this->commentsNum('%d'); ?> </span>
</div>
</div>
</div>
</a>
</article>
版权属于:dingzhenhua
本文链接:https://cloud.tencent.com/developer/article/2019353
转载时须注明出处及本声明
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有