Created
July 11, 2022 12:29
-
-
Save someguy9/7b22f02fd45f8fc231f4db642f5f8e6f to your computer and use it in GitHub Desktop.
Get current page URL in WordPress
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 ) ); | |
echo $current_url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment