引言

心水别人的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>