How can I display the number of post associated to a category in Twig/Timber WordPress? [closed]
You’re assuming that get_terms() returns an object with a count property, but it doesn’t. From the docs: Return (WP_Term[]|int[]|string[]|string|WP_Error) Array of terms, a count thereof as a numeric string, or WP_Error if any of the taxonomies do not exist. See the function description for more information. Also, the way you’re calling get_terms() is deprecated. There … Read more