chihung
10/17/2019 - 2:23 AM

get title from category

Examples
This example displays the text “Currently browsing ” followed by the category title.

1
<p><?php single_cat_title('Currently browsing '); ?>.</p>
Result:

Currently browsing WordPress.

This example assigns the current category title to the variable $current_category for use in PHP.

1
<?php $current_category = single_cat_title("", false); ?>

https://developer.wordpress.org/reference/functions/single_cat_title/