Fix issue with WP loading wrong index.php

This commit is contained in:
QWp6t
2015-12-29 15:54:06 -08:00
committed by Ben Word
parent 16b649627a
commit 9e2917e4d5

View File

@@ -15,11 +15,12 @@
* *
* themes/sage/index.php also contains some self-correcting code, just in case the template option gets reset * themes/sage/index.php also contains some self-correcting code, just in case the template option gets reset
*/ */
add_filter('template', function ($template) { add_filter('stylesheet', function ($stylesheet) {
return dirname($template); return dirname($stylesheet);
}); });
add_action('after_switch_theme', function () { 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');
}); });
/** /**