I’m in the process of creating a theme that will have several different setup options based on input from the administrator. One of the options will be to have a Zurb or Basic type layout.
I’m working with SCSS and want to have my stylesheets in a separate sub folder from the main theme files, cleanliness aside this is the easiest way for me to build/upload the files using my configuration of Sublime Text. I’ve been able to accomplish this easily enough and tell WP where to find the CSS folders for the specific setups. But WP STILL requires me to have a style.css document in the root of the theme or the admin panel will tell me the theme is broken. I realize this is due to WP looking for the Theme Header information located in the style.css/index.php files. Is there a way to tell WordPress to look else where for the Theme Header info?
I know you can @import
the CSS files into this main style.css easily enough. I however would prefer that the style.css file in the main folder not exist entirely.
Is there a function call / hook / filter / ect. that can be used to tell the WP admin panel that the main template/stylesheet files are actually in a different sub folder? All of the other articles I’ve read on the subject will explain how to do the @import
feature into the main style.css file, or suggest using stylesheet_directory_uri();
. Both of these methods still require you to have a style.css in the root folder. I haven’t seen a suggestion that actually addresses forcing WP to handle it differently.
Even if this means editing the core (which is something I normally would never do) I’m fine with that. I just want to know how. The solutions I mentioned above will solve my problem if all else fails.
Answered by @Vino here: https://stackoverflow.com/questions/12066316/sub-folder-css-template-headers-that-are-read-by-admin-panel/12139043#comment16259096_12139043
“File
wp-includes/class-wp-theme.php
, line 191, WP 3.4.1 source. but… there are no filters, and the class isfinal
. You can edit at your peril, ’cause updates to WP will overwrite your efforts.”There’re lots of filters available, The one I found in
get_stylesheet_directory_uri ()
function is –stylesheet_directory_uri
(wp-includes/theme.php#L166)Example –