How to get the current post slug?
-
Hi,
I′m designing a new theme and I need to know the current post slug(post name sanitized), so I can make a different header image for each Page.
For example, I have a page called “iPod Nano” and I need a function that returns “ipod-nano”.
I′ve searched for this on Codex, Google, functions.php, etc and I didn′t find anything nice. I only found this $posts[0]->post_name; but its too “dirty”
Any ideas and/or different approach will be greatly aprreciated. Thanks in advance, and sorry my bad English.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘How to get the current post slug?’ is closed to new replies.