• I want to show the post count in category templates as below:
    Showing <?php echo $category_count ?> results

    I use code like this:

    <?php  $cat = get_the_category();
    $cat = $cat[0];
    $category_count = $cat->category_count;?>

    It’s running in children’s category page, but wrong in parent category page,
    In parent page, it just show one of children’s count.

    how to fix it?

  • The topic ‘How to show category count which includes its children’ is closed to new replies.