I’ve had a look around already but couldn’t find an answer to this.
Is there a way to create a template that applies to all pages that have a parent? something like sub-page.php without having to manually select it from the page attributes?
I’ve had a look around already but couldn’t find an answer to this.
Is there a way to create a template that applies to all pages that have a parent? something like sub-page.php without having to manually select it from the page attributes?
Just build it directly into your page.php
template. e.g.:
<?php
global $post;
if ( $post->post_parent ) {
// This is a child Page; do something
}
?>