wordpress获取封面
Use the wp_count_posts() function to get the posts count.
The code:
使用wp_count_posts()函数获取帖子数。
代码:
<?php
$count_posts = wp_count_posts();
$count_pages = wp_count_posts('page');
echo "<li><a href=" . get_option('home') . ">";
echo $count_posts->publish . " Posts, " . $count_pages->publish . " Pages";
echo "</a></li>"
?>
翻译自: https://www.systutorials.com/get-the-number-of-all-posts-in-wordpress/
wordpress获取封面