/ Published in: PHP
This is a really short function you can use inside The Loop to get the parent page slug (useful to add to the body classes or something)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function get_parent_slug(){ $parent = get_page($post->post_parent); return $parent->post_name; }