Hi,
is there a way to get current page's slug outside the loop?
Hi,
is there a way to get current page's slug outside the loop?
If you know the page ID, you can do something like this:
<?php
$post_id = 11;
$post = get_post($post_id);
$slug = $post->post_name;
?>You must log in to post.