Получите текущую страницу слизняком
$slug = get_queried_object()->post_name;
Wide-eyed Wallaby
$slug = get_queried_object()->post_name;