欢迎使用 Typecho


如果您看到这篇文章,表示您的 blog 已经安装成功.

Akina主题自设Github-0d84142

安装:

将Akina文件夹放到typecho下/usr/themes,在后台外观下启用。

修改背景图

usr/themes/Akina/images/headerbg.jpg
也可在后台外观-设置外观自定义路径

修改首页头像

usr/themes/Akina/images/headerbg.jpg/akinadeaava.jpg

修改站点Logo

usr/themes/Akina/images/headerbg.jpg/akina.png

取消首页的社交信息、公告内容、聚焦内容

注释掉Akina/index.php -社交信息-
注释掉Akina/index.php -顶部公告内容-
注释掉Akina/index.php -聚焦内容-

取消文章页面的赞赏按钮

注释掉/Akina/post.php -赞赏按钮-

添加横幅文章日期、页面字数统计、加载时间

Akina文件夹下进行
一、
编辑functions.php
倒数第二行添加:

//字数统计
function  art_count ($cid){
$db=Typecho_Db::get ();
$rs=$db->fetchRow ($db->select ('table.contents.text')->from ('table.contents')->where ('table.contents.cid=?',$cid)->order ('table.contents.cid',Typecho_Db::SORT_ASC)->limit (1));
echo mb_strlen($rs['text'], 'UTF-8');
}

//加载耗时
function timer_start() {
        global $timestart;
        $mtime     = explode( ' ', microtime() );
        $timestart = $mtime[1] + $mtime[0];
        return true;
    }
    timer_start();
    function timer_stop( $display = 0, $precision = 3 ) {
        global $timestart, $timeend;
        $mtime     = explode( ' ', microtime() );
        $timeend   = $mtime[1] + $mtime[0];
        $timetotal = number_format( $timeend - $timestart, $precision );
        $r         = $timetotal < 1 ? $timetotal * 1000 . " ms" : $timetotal . " s";
        if ( $display ) {
            echo $r;
        }
        return $r;
    }

二、
1:横幅文章标题添加日期显示与最后更新时间
最后更新时间文章编辑页面需添加自定义字段up
编辑post.php
Ctrl+F搜索

<header class="pattern-header"><h1 class="entry-title"><?php $this->title() ?></h1></header>

替换为

    <header class="pattern-header">
        <h1 class="entry-title"><?php $this->title() ?></h1>
        <?php $this->date('Y-m-d'); ?>
        <br>
        Last Updated on
        <?php $this->fields->up();?>
    </header>

2:字数统计与页面加载时间
Ctrl+F搜索

<div class="breadcrumbs">

回车另起一行添加如下

当前位置: <a itemprop="breadcrumb" href="<?php $this->options ->siteUrl(); ?>">Home</a> » <?php print_r($this->category());?> » <span class="current"><?php $this->title() ?></span><br>加载本页耗时:<?php echo timer_stop();?> | 全文:<?php echo art_count($this->cid); ?>字

新标签页打开文章页面

编辑header.php在另起一行添加

<base target="_blank"/>

自定义页脚

编辑footer.php自定义

自定义首页文章缩略图

喜欢的图片移动到Akina/images/random里面,命名为
deu1.jpg
deu2.jpg
deu3.jpg
......
文章缩略图不止七张还需编辑Akina目录下index.php
Ctrl+F

<a href="<?php $this->permalink() ?>"><div class="overlay"><i class="iconfont">&#xe61e;</i></div><img src="<?php echo theurl.'images/random/deu'.mt_rand(1,7).'.jpg'; ?>"></a>
将数字:7 修改为最大图片数即可

自定义文章顶部图片

喜欢的图片移动到Akina/images/postbg里面,命名为
1.jpg
2.jpg
3.jpg
...
顶部图片不止三张还需编辑Akina目录下post.php
Ctrl+F

echo theurl.'images/postbg/'.mt_rand(1,3).'.jpg';

将数字:3 修改为最大图片数即可

由于Akina支持自定义字段img以及值img地址作为文章首页图片,所以删除默认的文章第一张图片默认作为文章顶部图片

编辑post.php
Ctrl+F

    <?php 
        if (array_key_exists('img',unserialize($this->___fields()))){
            $this->fields->img(); 
        } else {
            if(img_postthumb($this->content) != null){
                echo img_postthumb($this->content);
            }else {
                echo theurl.'images/postbg/'.mt_rand(1,3).'.jpg';
            }
        }
    ?>
替换为
    <?php 
        if (array_key_exists('img',unserialize($this->___fields()))){
            $this->fields->img(); 
        } else {
                echo theurl.'images/postbg/'.mt_rand(1,3).'.jpg';
        }
    ?>

修改文章标题#

usr/themes/Akina/css/style.css
Ctrl+F搜索:
entry-header
修改为

.entry-header h1:before {
    content: ">";
    margin-right: 6px;
    color: #ff6d6d;
    font-size: 20px;
    font-weight: 600;
}

.entry-headers h1:after {
    content: "<";
    margin-left: 6px;
    color: #ff6d6d;
    font-size: 20px;
    font-weight: 600;
}

post.php Ctrl+F搜索

<header class="entry-header">

修改为

<header class="entry-header entry-headers">

移动布局显示版权信息

usr/themes/Akina/css/style.css

.open-message {display:none}
}

修改為

.open-message {display:block}
}

插件

AllsitePasswd --Typecho全站密码访问
DynamicLines --简单的,有丰富自定义项的页面下雪插件
Snowstorm --有丰富自定义选项的动态聚合线条特效插件
AliOss --阿里云Oss附件上传

声明:吃蛋的小子|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - 欢迎使用 Typecho


我,俺床,咱手机。