Codex tools: Log in
Retrieve category based on URL containing the category slug.
Breaks the $category_path parameter up to get the category slug.
Tries to find the child path and will return it. If it doesn't find a match, then it will return the first category matching slug, if $full_match, is set to false. If it does not, then it will return null.
It is also possible that it will return a WP_Error object on failure. Check for it when using this function.
<?php get_category_by_path( $category_path, $full_match, $output ) ?>
<?php $categ = get_category_by_path('uncategorized'); echo "Category ".$categ->name; ?>
get_category_by_path() is located in