Reputation: 514
I have an URL like this https://example.com/parent-category/child-category/
With the function single_cat_title()
$category = single_cat_title('', false);
I am getting the name of the active category. Now, how can I get the details of the category with the name I am getting in the $category
variable?
Upvotes: 0
Views: 32
Reputation: 301
<?php $queried_object = get_queried_object();
print_r( $queried_object ); ?>
Upvotes: 1