Using this code I can easily get the total number of posts:
$post_count = count_user_posts();
echo $post_count;
But I need the total to not include posts that are uncategorized.
Use the following code and see the output:
$args = array('posts_per_page' => -1,'category' => '-1',);
$posts_array = get_posts( $args );
echo count($posts_array);
As default, id of uncategorized
category is 1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With