Answers for "php get slug"

PHP
0

php get slug

You can get that using the following methods:

<?php $post_slug = get_post_field( 'post_name', get_post() ); ?>
Or You can use this easy code:

<?php
    global $post;
    $post_slug = $post->post_name;
?>
Posted by: Guest on March-23-2021

Browse Popular Code Answers by Language