I have created a simple menu with list of Categories and Count of post inside category 78.
<?php
$args = array(
'orderby' => 'name',
'parent' => '78'
);
$categories = get_categories( $args );
foreach ( $categories as $category ) {
echo
'<h2>' . $category->name . ' (' . $category->count . ')</h2>';
}
?>
I want to show count of ALL posts including SUB-Category posts, but with this code it only shows the Category count for main Category and SUB-Categories are not included in Count.
Is it possible to get count of all posts within a category including all post count in sub categories if any?