If someone can help me with this issue, it would be very much appreciated.
it is caused by some style for the category links with ‘display: block;’
which you may want to keep because it is for the styling of the whole line background.
you could add a filter function to functions.php of your theme, to ‘pull’ the category count numbers into the link:
add_filter('wp_list_categories', 'cat_count_inline');
function cat_count_inline($links) {
$links = str_replace('</a> (', ' (', $links);
$links = str_replace(')', ')</a>', $links);
return $links;
}
obvious change – the numbers in the brackets are now part of the link – and should be on the same line.
Hi alchymyth. Thank you for the info. Your suggestion works for the categories section. Any idea how I would do that for the archives section as well?
try to add this filter code to functions.php of your theme:
add_filter('get_archives_link', 'archive_count_inline');
function archive_count_inline($links) {
$links = str_replace('</a> (', ' (', $links);
$links = str_replace(')', ')</a>', $links);
return $links;
}
That did the trick! Thank you so much alchymyth. 🙂