If you found the function, that’s the first step. I’m not a fan of modifying core files, but I’ve never replace a function before, so this is all I can advise.
Inside list_cats, immediately after $num_found++;, put this:
$link = '';
//note this is two single quotes
Then move everything from
if ( (! empty($feed_image)) || (! empty($feed)) ) {
to it’s closing } to right after our new $link = '';
statement.
Then change this (should be the very next thing after our additions):
$link = '<a href="'.get_category_link($category->cat_ID).'" ';
to
$link .= '<a href="'.get_category_link($category->cat_ID).'" ';
(the only change is a . before the =
If it borks, just replace the file with your backup, and we’ll try again. Hopefully you’ll have what you want. This is modifying a core file though, so it will break during an upgrade. If someone else can advise how to replace this function with a plugin, then great.