If my current url is www.example.com/thank-you, how do I echo out the page name in a wordpress way.
+2
A:
WordPress Way:
echo $post->post_name;
Normal Way: (Should work in WP too)
echo $_SERVER['PHP_SELF'];
Sarfraz
2010-03-10 06:24:06
thanks! I'm just in a hurry.
jun
2010-03-10 06:30:06
I doubt `$_SERVER['PHP_SELF'];` would return anything that looks like `www.example.com/thank-you` or `/thank-you`
Col. Shrapnel
2010-03-10 06:59:08
@jun: You are welcome :)
Sarfraz
2010-03-10 07:37:12