Posted at

現在のページのスラッグ名を取得する

More than 5 years have passed since last update.


PHP

<?php $slug_name = basename(get_permalink()); ?>


or


PHP

<?php $slug_name = $post->post_name; ?>