How to add a tag above a category post that displays the category name in WordPress

There is single_cat_title() that should do what you want.

Description

Displays or returns the page title if a category or tag archive is queried. Therefore, the
function can be used only outside the loop.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)