Last active
October 22, 2015 08:26
-
-
Save ville6000/dd24b0830b0d37d999f4 to your computer and use it in GitHub Desktop.
Get 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
<?php | |
function get_current_url() { | |
global $wp; | |
return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment