Skip to content

Instantly share code, notes, and snippets.

@JamieWritesCode
Last active May 24, 2016 00:59
Show Gist options
  • Save JamieWritesCode/9ca00c09b44a0e3242ed2daba9e9fa1d to your computer and use it in GitHub Desktop.
Save JamieWritesCode/9ca00c09b44a0e3242ed2daba9e9fa1d to your computer and use it in GitHub Desktop.
Wordpress snippet to return current page URL from any template.
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment