CountPost WordPress Custom Taxonomy
What's the easiest way to add "count posts" to the category listing as seen as below?
?php
if($categories){
foreach($categories as $category) {
$output .= 'lia href="'.get_category_link( $category-term_id ) . '" title="' . esc_attr( sprintf( esc_html__( 'View all posts in %s','themename' ), $category-name ) ) . '"' . $category-name . '/a/li' . $separator;
}
echo trim($output, $separator);
}