Skip to content

Instantly share code, notes, and snippets.

@fikrirasyid
Created July 22, 2014 06:59
Show Gist options
  • Save fikrirasyid/0e4e8d72fcee17a2096c to your computer and use it in GitHub Desktop.
Save fikrirasyid/0e4e8d72fcee17a2096c to your computer and use it in GitHub Desktop.
Getting Current URL in WordPress
/**
* Get current URL
*
* @return string
*/
function current_url(){
global $wp;
$current_url = trailingslashit( home_url( $wp->request ) );
return $current_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment