2

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?

1

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
}
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.