Created
November 26, 2016 08:30
-
-
Save sjaved87/7f72933b91fabd3a4a09d420c864b474 to your computer and use it in GitHub Desktop.
WordPress - Get current page URL on any page, post, home or any archive page (category, author, custom post type).
This file contains 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 | |
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