tags:

views:

51

answers:

1

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
thanks! I'm just in a hurry.
jun
I doubt `$_SERVER['PHP_SELF'];` would return anything that looks like `www.example.com/thank-you` or `/thank-you`
Col. Shrapnel
@jun: You are welcome :)
Sarfraz