Created
November 16, 2016 09:47
-
-
Save pmbaldha/1f674d27824b44c21abdbb2bdb9e7e77 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
global $wp; | |
$current_url = home_url(add_query_arg(array(),$wp->request)); |
Thanks @MishukAdhikari
Your answer is worked for me!
$current_url = home_url($_SERVER['REQUEST_URI']);
Thanks @MishukAdhikari
Your answer worked for me too!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$current_url = home_url($_SERVER['REQUEST_URI'])