WordPress Category Question

I had a similar question, and the solution was to add a function in functions.php.

How to get current_cat in navbar, in single post