Created
September 2, 2015 02:52
-
-
Save mauriciogofas/c1aa85eafedb0b8a77cf to your computer and use it in GitHub Desktop.
How to Get the Current URL in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $wp; | |
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment