I've attempted to install a theme on a Wordpress installation in a Windows development environment, which will be synced through Git with a production environment in CentOS.
The theme has a file called
loader.php which appends
get_template_directory() with a subdirectory path that uses forward slashes. As you can probably guess, this results in a directory separator mismatch that has broken my entire site.
I know the proper answer to this is to use
get_template_directory_uri(), but I'd like to avoid editing the parent theme as much as possible in order to reduce incompatibility with future updates, and instead keep any edits to the child theme (which of course does not have
Is there another workaround that I could possibly use to fix this that doesn't involve editing theme files and maintains compatibility with both Windows and CentOS?
The code in question:
if ( ! defined( 'THEME_PATH' ) ) define( 'THEME_PATH', trailingslashit( get_template_directory() ) ); require_once THEME_PATH . 'includes/theme.options.php';
This is returning:
Fatal error: require_once(): Failed opening required 'C:\Users\<name>\Sites\dev/wp-content/themes/<themename>/includes/theme.options.php' (include_path='.;C:\php\pear') in C:\Users\<name>\Sites\dev\wp-content\themes\<themename>\fw\loader.php on line 62