I’m trying to echo the value of the variable in the code below. I’m getting an error (see below)…
Here’s the code…
$mypagecount = wp_count_posts('page');
echo $mypagecount;
Here’s the error:
Catchable fatal error: Object of class stdClass could not be converted to string
The wp_count_posts function returns an object.
You can ask the object to return the number of publish items.
For more information:
http://wpengineer.com/show-amount-of-posts-pages-categories-tags-comments-for-wordpress-themes/