So if I search 'How to get current page slug', there are bunch of results that suggest to use following snippet.
global $post; $post_slug = $post->post_name; echo $post_slug;
But issue is, if I use it on pages where there is default loop, it will return slug of very first post from the default loop. What am I missing here? This answer seems globally accepted, am I doing something wrong?