how to retrieve the Slug of a page outside the loop
-
This is the most common tasks i have to do – how can i do it outside the loop (by passing the page ID)
in other words:
function get_parentSlug() { global $post; $parentID = $post->post_parent; get_post_slug($parentID); return $parentSlug; }
except why is there no function called simply “get_post_slug”?! or even “get_post_name”
it boggles the mind
jake
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘how to retrieve the Slug of a page outside the loop’ is closed to new replies.