前台删除文章确认

    //post-meta-more
    $(document).ready(function() {
        $(document).on('click','.post-meta-more b', function () {
            var thiz = $(this).parent();
            $('.post-meta-more').not(thiz).removeClass('show');
            thiz.toggleClass('show');
        });
        $(document).on('click',function(event){
            if(!$(event.target).closest('.post-meta-more').length){
                $('.post-meta-more').removeClass('show');
            }
        })
        $('article').fadeIn();
    });
    //前台删除文章确认
    $('.delete').click(function () {
        if (confirm('<?php _e('您确认要删除吗?'); ?>')) {
            window.location.href = $(this).attr('href');
        }

        return false;
    });

随机调用文章

class Rande extends Widget_Abstract_Contents
{
    /**
     * 随机调用文章
     */
    public function execute()
    {
        $this->parameter->setDefault(['pageSize' => $this->options->postsListSize]);

        $this->db->fetchAll($this->select()
            ->from('table.contents')
            ->join('table.relationships', 'table.contents.cid = table.relationships.cid')
            ->where('table.contents.type = ?', 'post')->where('table.relationships.mid = ?', $this->parameter->mid)
            ->where('table.contents.status = ?', 'publish')
            ->where('table.contents.created < ?', $this->options->time)
            ->where('table.contents.type = ?', 'post')
            ->order($this->parameter->order?$this->parameter->order:'table.contents.created', Typecho_Db::SORT_DESC)
            ->limit($this->parameter->pageSize), [$this, 'push']);
    }
}
<?php $this->widget('Rande@Rande', 'pageSize=10&mid=7&order=rand()')->to($rand); ?>

根据分类slug调用mid

根据源码内容,获取当前页面的mid有更方便的方式
$this->getPageRow()['mid']
下面的方式可以用于非当前页面,暂时还没想到用在哪里,先放着吧
function cmid($slug){  //根据栏目slug获取栏目id,cmid($this->getArchiveSlug())
    $db = Typecho\Db::get();
    $cmid = $db->fetchRow($db->select()->from ('table.metas')->where ('slug=?',$slug)->where('type=?', 'category'));
    return  $cmid['mid']; 
 }
//使用方法
<?php cmid($this->getArchiveSlug())?>
<?php cmid($slug)?>

分类指定模板方法

网上部分内容不太合适

<?php
    $slugArray = array('game','loneone','web','observer','lifes');
    if(in_array($this->getArchiveSlug(),$slugArray)){
        $this->need('category-life.php');
    }else {
        $this->need('archive-default.php');
    }
?>

横向放的就是因为transform导致z-index不起作用的