• I currently creating a child theme based off of another theme, how do you remove a parent page template from the page template selection without destroying it from the parent?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Richard Coan

    (@egeis)

    Well after some reading I’m guessing there is no way to do this. Time for plan B, Merge Child with Parent and delete the unnecessary templates…

    This technique will do what you’re looking for.

    Here is Rarst’s code, verbatim:

    add_action('admin_head-post.php','remove_template');
    
    function remove_template() {
    
        global $wp_themes;
    
        get_themes();
        $templates = &$wp_themes['Twenty Ten']['Template Files'];
        $template = trailingslashit( TEMPLATEPATH ).'onecolumn-page.php';
        $key = array_search($template, $templates);
        unset( $templates[$key] );
    }

    Obviously, this goes into your plugin .php file or your functions.php file…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing page template from child theme.’ is closed to new replies.