Get taxonomy slug from url

I think you are looking for get_query_var

$term_slug = get_query_var( 'term' );
$taxonomyName = get_query_var( 'taxonomy' );
$current_term = get_term_by( 'slug', $term_slug, $taxonomyName );

Leave a Comment