WordPress网站信息统计代码总结

获取文章(post)总数 获取文章总数应该使用WordPress API中wp_count_posts()函数,一般能使用API获取的信息,就不要直接去查询,除非使用API实现资源消耗太大。php 1 2 3 4 5 6 7 8 9 $count_posts = wp_count_posts(); $published_posts = $count_posts ->publish; //已发布文章
相关文章
相关标签/搜索