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.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
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 :)