Skip to content

Instantly share code, notes, and snippets.

@jondueck
Created June 3, 2015 13:14
Show Gist options
  • Save jondueck/ac5ebc60ab5b71679e19 to your computer and use it in GitHub Desktop.
Save jondueck/ac5ebc60ab5b71679e19 to your computer and use it in GitHub Desktop.
Wordpress: If parent is page id, set child page theme
<?php
if (134 == $post->post_parent) {
include (TEMPLATEPATH . '/page-mysubpagetemplate.php'); // Name this for your child page template name
exit();
} else {
// Do something else
// You might want to stick your regular page.php code in here, or alternatively, you could call another template
}; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment