Hey, I’m trying to add a Body ID to my different pages, the following works fine for all the parent pages:
<body id="<?php echo $post->post_name; ?>">
but for any sub-pages it pulls the name of the sub-page. How could I change this to only use the parent page slug as the id?
- The topic ‘Add Body ID to Control Page Elements’ is closed to new replies.