From 9e2917e4d5d9bc6ec5ddf62686312781e8144415 Mon Sep 17 00:00:00 2001 From: QWp6t Date: Tue, 29 Dec 2015 15:54:06 -0800 Subject: [PATCH] Fix issue with WP loading wrong index.php --- functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 327b6d0..730c84a 100644 --- a/functions.php +++ b/functions.php @@ -15,11 +15,12 @@ * * themes/sage/index.php also contains some self-correcting code, just in case the template option gets reset */ -add_filter('template', function ($template) { - return dirname($template); +add_filter('stylesheet', function ($stylesheet) { + return dirname($stylesheet); }); add_action('after_switch_theme', function () { - update_option('template', get_option('template') . '/templates'); + $stylesheet = get_option('stylesheet'); + basename($stylesheet) == 'templates' || update_option('stylesheet', $stylesheet . '/templates'); }); /**