Skip to content

Instantly share code, notes, and snippets.

@natejacobson
Created June 23, 2015 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natejacobson/4cf46f8110afecc7bf26 to your computer and use it in GitHub Desktop.
Save natejacobson/4cf46f8110afecc7bf26 to your computer and use it in GitHub Desktop.
Prune WordPress Template List in Child Theme
function prune_page_templates( $templates ) {
unset( $templates['templates/halves.php'] );
unset( $templates['templates/margin-left.php'] );
unset( $templates['templates/margin-right.php'] );
unset( $templates['templates/side-left.php'] );
unset( $templates['templates/side-right.php'] );
unset( $templates['templates/single.php'] );
return $templates;
}
add_filter( 'theme_page_templates', 'prune_page_templates' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment