PureLoveForTypecho主题设置 & 一些备忘

PureLoveForTypecho主题地址:

https://gitee.com/HoeXhe/PureLoveForTypecho

typecho插件商店地址:

https://github.com/typecho-fans/plugins

logo地址:

https://i.loli.net/2018/12/13/5c120414f06c8.png

ico:/favicon.ico

文章列表图片自动宽度,修改style.css

 .postspicbox {width: auto;padding: 2px; }

导航栏一行输出:

<ul id="menu-menu" class="menu font-size-14">
    <li>
        <a href=<?php $this->options->siteUrl(); ?>><i class="fa fa-home"></i><?php _e('首页'); ?></a>
    </li>
    <!--分类-->
    <?php $this->widget('Widget_Metas_Category_List')->to($cats);?>
    <?php while ($cats->next()): ?>
    <li>
        <a href="<?php $cats->permalink()?>"><i class="fa fa-list-ul"></i> <?php $cats->name()?></a>
    </li>
    <?php endwhile; ?>
    <li>
        <a href="/tool/index.html" target="_blank"><i class="fa fa-list-ul"></i>小工具</a>
    </li>
    <!--独立的页面-->
    <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
    <?php while($pages->next()): ?>
    <li>
        <a href="<?php $pages->permalink(); ?>"><i class="fa fa-list-ul"></i> <?php $pages->title(); ?></a>
    </li>
    <?php endwhile; ?>                    
</ul>

pjax需要在purelove.js修改代码:

function pjaxComplete() {
    NProgress.done(); // 加载动画效果结束
    // 重新加载代码高亮
    codeHighlight();
    openNew();
    banner();
    tooltip();
    reloadEmoji();
    
    //加载图片效果
    loadSlimbox();
    
    //加载统计代码
    loadStaticts();
    
    //重新解析页面emoji表情
    emojify.run();
}

统计代码:

<script>
    function loadStaticts(){
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://js.users.51.la/19796861.js";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
    }
    loadStaticts();
</script>

将footer.php文件加载统计代码改为:

<?php if ($this->options->tongJiJs): ?>
<?php $this->options->tongJiJs(); ?>
<?php endif; ?>

去掉疯狂打字机效果:footer.php

<script src="<?php $this->options->themeUrl('js/activate-power-mode.js'); ?>"></script>

轮播JSON:

[{"imgUrl":"https://i.loli.net/2018/11/24/5bf8cb97b67ba.jpg","url":"#","desc":"最美的时刻,遇到最美的你"},{"imgUrl":"https://www.jiffei.com/usr/themes/PureLoveForTypecho/images/banner1.jpg","url":"#","desc":"For you, a thousand times over. 为你,千千万万遍。--《追风筝的人》"},{"imgUrl":"https://www.jiffei.com/usr/themes/PureLoveForTypecho/images/banner2.jpg","url":"#","desc":"This path has been placed before you. The choice... 路就在你脚下,你自己决定。 —星球大战"},{"imgUrl":"https://www.jiffei.com/usr/themes/PureLoveForTypecho/images/banner3.jpg","url":"#","desc":"无论问题有多大,告诉你的心,一切皆好,朋友。—《三傻大闹宝莱坞》"}]

返回顶部太慢了,修改purelove.js代码:

jQuery('#bak_top').click(function () {
        jQuery('html,body').animate({scrollTop: '0px'}, 100);
    });

调整文章列表的随机图片,functions.php 文件

/**
 * @param $article
 * @return string
 * 文章无图时, 随机输出缩略图
 */
function articleThumb($article)
{
    // 当文章无图片时的默认缩略图
    $pattern = '/<img[\s\S]*?src\s*=\s*[\"|\'](.*?)[\"|\'][\s\S]*?>/';
    preg_match_all($pattern, $article->content, $matches);
    if (isset($matches[1][0])) {
        $thumb = $matches[1][0];
    } else {
        $myimgs = array("https://i.loli.net/2018/12/15/5c14a4a261c4a.jpg","https://i.loli.net/2018/12/15/5c14a4b38284c.jpg","https://i.loli.net/2018/12/15/5c14a4b3db9b3.jpg","https://i.loli.net/2018/12/15/5c14a4b613bf7.jpg","https://i.loli.net/2018/12/15/5c14a4b6f1c89.jpg","https://i.loli.net/2018/12/15/5c14a4bd525f0.jpg","https://i.loli.net/2018/12/15/5c14a4c272794.jpg","https://i.loli.net/2018/12/15/5c14a4c42a852.jpg","https://i.loli.net/2018/12/15/5c14a4c8a6178.jpg","https://i.loli.net/2018/12/15/5c14a4d562654.jpg","https://i.loli.net/2018/12/15/5c14a52fb870c.jpg","https://i.loli.net/2018/12/15/5c14a53c5ca89.jpg","https://i.loli.net/2018/12/15/5c14a53c8b870.jpg","https://i.loli.net/2018/12/15/5c14a53e25e0a.jpg","https://i.loli.net/2018/12/15/5c14a54573794.jpg","https://i.loli.net/2018/12/15/5c14a546b2d79.jpg","https://i.loli.net/2018/12/15/5c14a548d0937.jpg","https://i.loli.net/2018/12/15/5c14a5491c602.jpg","https://i.loli.net/2018/12/15/5c14a54a63037.jpg","https://i.loli.net/2018/12/15/5c14a54a8117a.jpg");
        $thumb =$myimgs[mt_rand(0,19)];
    }
    return $thumb;
}

我来吐槽

*

*

已有 19 条评论

  1. LarryNak

    Get monetary savings with our less expensive producing assistance | Get great high quality papers of any problem stage but for your honest price tag!

  2. Rebeccavex

    You are my heart: http://clickfrm.com/yY5k

  3. Marieraize

    Take my heart - http://clickfrm.com/z99m

  4. Marieraize

    Take my heart - http://clickfrm.com/z99m

  5. MelissaAlief

    You are my heart: http://clickfrm.com/zbZL

  6. PamellaToibe

    You are my heart: http://clickfrm.com/zcbx

  7. PamellaToibe

    You are my heart: http://clickfrm.com/zcbx

  8. PamellaToibe

    You are my heart: http://clickfrm.com/zcbx

  9. MicheleMof

    You are my heart: http://clickfrm.com/z3ph

  10. BrendaRen

    Take my heart - http://clickfrm.com/zagM

  11. KristiFAK

    Take are my heart - http://clickfrm.com/zchp

  12. RickyGrold

    https://www.instagram.com/seotop.best/

  13. Sandraexite

    I'm yours - http://clickfrm.com/zyp7

  14. Mariahit

    I'm yours - http://clickfrm.com/zyp7

  15. SusanClorp

    You are my heart: http://clickfrm.com/zcbx

  16. CherylTah

    Young Teen Plays Her Own Pussy - http://clickfrm.com/zDvB

  17. AnaKnott

    Close up creamy pussy - http://clickfrm.com/zDvx

  18. JamieDip

    Busty milf rubbing her pussy - http://clickfrm.com/zDvX

  19. Debbiecaulk

    A new level of success: http://2track.info/ukDf