Typecho 修改后台文章排序方式

Typecho 修改后台文章排序方式

ZJ
ZJ
2022-09-12 / 0 评论 / 16 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2022年09月14日,已超过589天没有更新,若内容或图片失效,请留言反馈。
后台文章是按文章cid排序,修改为按发布时间排序,打开目录下/var/Widget/Contents/Post/Admin.php文件,查找如下代码:
/** 提交查询 */
$select->order('table.contents.cid', Db::SORT_DESC)
->page($this->currentPage, $this->parameter->pageSize);

$this->db->fetchAll($select, [$this, 'push']);

将上面代码中 table.contents.cid 改成 table.contents.created

编辑后台文章后页面跳转到第一页,打开目录下/var/Widget/Contents/Post/Edit.php文件,查找如下代码:
 /** 页面跳转 */
$this->response->redirect(Common::url('manage-posts.php?' . $pageQuery, $this->options->adminUrl));

将上面代码中 'manage-posts.php?' . $pageQuery 改成 'manage-posts.php?page=1'

本文共 85 个字数,平均阅读时长 ≈ 1分钟
0

评论 (0)

取消