Skip to content

Commit

Permalink
Fix issue with WP loading wrong index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t authored and retlehs committed Mar 11, 2016
1 parent 16b6496 commit 9e2917e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

/**
Expand Down

0 comments on commit 9e2917e

Please sign in to comment.