创建按点击阅读次数排列的wordpress热门文章列表-WordPress主题

摘要:很多的wordpress主题站点都是hot列表或是热门文章分类,怎样实现这个功能呢,其实很简单,只需要两组代码就可以实现…

很多的wordpress主题站点都是hot列表或是热门文章分类,怎样实现这个功能呢,其实很简单,只需要两组代码就可以实现。
首先我们要确保主题内有显示文章次数的代码,然后再对代码进行二次调用,怎样实现wordpress文章点击数次功能呢?将下面的代码复制到主题的functions.php文件内,可以实现主题的阅读量显示功能。

通过上面的代码增加功能之后,需要我们再运用下面的代码进行功能调用,将如下代码复制插入到想要显示浏览次数的位置上
这里是文章内容页面使用的。

这个是页面中使用的。

然后进入到我们最后的环节在需要调用文章的地方插入以下代码即可实现按点击数量排序的热门文章列表

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