Created
June 23, 2015 18:28
-
-
Save natejacobson/4cf46f8110afecc7bf26 to your computer and use it in GitHub Desktop.
Prune WordPress Template List in Child Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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