I have created a page template where I need current page URL
I have tried
but it shows nothing.
Let me know is anything missing in code.
if you're using a page template, then if you want to get the current page URL you could try to use this function:
if you want to print the result
You can get page url like this.
global $post; echo get_permalink( $post->ID );
Hope it helps :)