Sage 9: Theme must be activated prior to using the customizer

On previewing the just installed Sage 9 theme I get :

Sage › Error
Theme must be activated prior to using the customizer.

roots.io/sage/docs/ 

Would be nicer to be able to use the customizer / use preview right away. Will we keep this this way or are we going to be able to preview prior to activation?

Two, post activation I can customize from the Dashboard customize button, but not from the appearance > themes > customize . Then I get the same error again. So perhaps it is a bug…

Well aware :slight_smile: I’ve spent tons of time trying to get it to work.

This likely isn’t going to be worked on by us until https://core.trac.wordpress.org/ticket/13239 has landed in core. There’s a way to get it to work by using a plugin, but we’re not interested in requiring the use of a plugin in order to use Sage.

1 Like

Aha :smile: . I see now. Well, I added a +1 as well. After seven years it would be great to have this one taken care of. Read the whole debate and won’t add anything more to it really. Just hope one of the solutions - a filter would be nice - will be applied.

So did I get this right?
In order to preview the sage 9 theme I have to install the following plugin mentioned in this comment?

/*
    Plugin Name: Plugin that can override theme templates
    Version: 0.1
    Author: Mr. WordPress
    Description: Templates in this plugin's templates subdirectory will override the same-named template from the theme.
    */

    if ( !function_exists( 'add_plugin_template_path' ) ) :
    /**
     * The plugin's templates/ subdirectory may contain overrides for any theme template file
     */
    function add_plugin_template_path( $template_names ) {
    	$new_template_names = array();
    	foreach ( (array) $template_names as $tn ) {
    		$new_template_names[] = dirname( __FILE__ ) . '/templates/' . $tn;
    		$new_template_names[] = $tn;
    	}
    	return $new_template_names;
    }
    endif;
    add_filter( 'locate_template', 'add_plugin_template_path' );