Ooops not sure why i left those args in….
Ok for the changes you want to make use this Snippet instead:
add_shortcode('cat_listing', function($html){
$categories = get_categories();
$html = '';
foreach( $categories as $category ) {
$category_link = sprintf(
'<a href="%1$s" alt="%2$s">%3$s</a>',
esc_url( get_category_link( $category->term_id ) ),
esc_attr( $category->name ),
esc_html( $category->name )
);
$html .= '<h2>' . $category_link . '<sup>(' . $category->count . ')</sup></h2>';
$html .= '<p>' . $category->description . '</p>';
}
return $html;
});