I am trying to get category names for the ones that are available in permalink. e.g. I have the following permalink structure.
Where as category-1 and category-2 both are categories. When I try
$wp_query->get_queried_object(), it just returns info related to category-2. How can I get details of category-1 using any existing WordPress functions?