Created
July 11, 2022 12:40
-
-
Save someguy9/23527208bbb724c8d8bcb780fa894edf to your computer and use it in GitHub Desktop.
Get the current slug 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_slug = add_query_arg( array(), $wp->request ); | |
echo $current_slug; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment