wordpress不同分类显示不同的文章列表数量-WordPress主题

摘要:我们在使用wordpress建站中,常常会遇到自定义分类文章数量的操作,如wordpress教程分类需要显示20篇文章,…

我们在使用wordpress建站中,常常会遇到自定义分类文章数量的操作,如wordpress教程分类需要显示20篇文章,但是wordpress建站分类每页想显示10篇文章,怎样自定义每个分类列表的文章数量呢,今天推荐大家通过id判断分类然后进行自定义的列表文章数量调整
主要是判断你的wordpress主题当前分类的ID,然后按照你的意愿 ,向pre_get_posts添加自定义函数就可以了。
把代码放在archive.php文件内

来源:http://www.wazhuti.com/3327.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_12774.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?