How to know the total number of posts in a category and its subcategories (wordpress)?

It would seem the task is simple, but the solutions can not.
March 20th 20 at 11:20
2 answers
March 20th 20 at 11:22
Solution
Thank you! This is what you need. - demarco_Fra commented on March 20th 20 at 11:25
March 20th 20 at 11:24
wp_count_posts() - Gets the number of records in any record type and any status (published, draft).
Here you can read and an example of usage is
https://wp-kama.ru/function/wp_count_posts
Function wp_count_posts() does not allow to work with a specific category. - demarco_Fra commented on March 20th 20 at 11:27

Find more questions by tags WordPress