<?php global $post; $post_slug=$post->post_name; ?>
This code is used after
<head> and before
<body> and is supposed to get current page's slug. It works great, however it will get the slug of first blog post when on "general" blog page.
- Blog url:
www.my-site.com/blog/ ->slug in admin area is set to
- Blog post url:
www.my-site.com/post-1/ ->slug in admin area is set to
post-1 for both. Any ideas?