wordpress分类列表调用该分类置顶文章-WordPress主题

摘要:实用互动型wordpress主题需要分类目录需要分别展示各目录的热门文章用来丰富栏目内容。所以分类列表显示分类的置顶文章…

实用互动型wordpress主题需要分类目录需要分别展示各目录的热门文章用来丰富栏目内容。所以分类列表显示分类的置顶文章会使用户体验更加友好

在当前主题的分类列表模板中添加代码:

在正常的分类列表中排除已经设置为置顶的文章:

其实就是在主循环中添加if(!is_sticky())来判断,表示如果不是置顶文章则显示。

来源:http://www.wazhuti.com/424.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_13016.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?