Typecho默认的文章展示(主页)顺序为创建时间,我们假设需要按照修改时间进行排序,那么就需要进行源码的修改,修改 table.contents.createdtable.contents.modified,具体内容如下:

    // File path: var/Widget/Archive.php

        /**(Line 761) 仅输出文章 */
        $this->countSql = clone $select;
        // table.contents.created ==> table.contents.modified
        $select->order('table.contents.modified', Db::SORT_DESC)
            ->page($this->currentPage, $this->parameter->pageSize);
        $this->query($select);
最后修改:2023 年 08 月 28 日
如果觉得我的文章对你有用,请随意赞赏