Warning: getimagesize(): open_basedir restriction in effect. File(/etc/pki/tls/certs/ca-bundle.crt) is not within the allowed path(s): (/www/wwwroot/rinvay.cc/:/tmp/) in /www/wwwroot/rinvay.cc/usr/plugins/AMP/Action.php on line 469

Warning: failed loading cafile stream: `/etc/pki/tls/certs/ca-bundle.crt' in /www/wwwroot/rinvay.cc/usr/plugins/AMP/Action.php on line 469

Warning: getimagesize(): Failed to enable crypto in /www/wwwroot/rinvay.cc/usr/plugins/AMP/Action.php on line 469

Warning: getimagesize(https://www.rinvay.cc/img/logo.png): failed to open stream: operation failed in /www/wwwroot/rinvay.cc/usr/plugins/AMP/Action.php on line 469
Typecho 自定义文章列表显示条数

Rinvay.H Blog

Typecho 自定义文章列表显示条数

做模板可能要限制某个分类文章显示条数,这个就需要用到这个代码了。

模板中定义

编写模板的 functions.php 文件,加入以下代码:

function themeInit($archive) {
if ($archive->is('category', 'jobs')) {
$archive->parameter->pageSize = 10; // 自定义条数
}
}

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »