Skip to content

Instantly share code, notes, and snippets.

@mstoic
Created April 18, 2021 16:45
Show Gist options
  • Save mstoic/f5a8dff3b5cf3d1bd188ad892ba25258 to your computer and use it in GitHub Desktop.
Save mstoic/f5a8dff3b5cf3d1bd188ad892ba25258 to your computer and use it in GitHub Desktop.
WordPress - Get The Current Page URL
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