SyntaxFix
Write A Post
Hire A Developer
Questions
this simple code worked for me:
$postId = get_the_ID(); $slug = basename(get_permalink($postId)); echo $slug;