Show Slug of a Page

Create a custom function like this::

function the_slug() {
    global $post;
    $post_slug = $post->post_name;

    return $post_slug;
}

If you want to show the slug, you can now call the function defined above:

<?php echo the_slug(); ?>