Skip to content

Instantly share code, notes, and snippets.

@renanlara
Last active February 19, 2016 14:32
Show Gist options
  • Save renanlara/052deb76585f388dcb83 to your computer and use it in GitHub Desktop.
Save renanlara/052deb76585f388dcb83 to your computer and use it in GitHub Desktop.
Especifique qual arquivo usar para páginas filhas.
<?php
/**
* Espeficicar por padrão.
*/
if( $post->post_parent !== 0 ) {
get_template_part('page', 'child');
} else {
get_template_part('page', 'default');
}
?>
<?php
/**
* Espeficicar por ID.
*/
if(!in_array($post->post_parent, array(15, 11, 17, 13))) {
get_template_part('page', 'default');
} else {
get_template_part('page', 'child');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment