Created
October 13, 2022 19:09
-
-
Save scottnunemacher/41396b8aafbc0e08ac3b9f28d99d5fab to your computer and use it in GitHub Desktop.
WP Get Post Slug
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 | |
$slug = get_post_field( 'post_name', get_post() ); | |
echo $slug; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy way to get post slug.