Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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 -

    add_filter('stylesheet_directory_uri','wpse62567_stylesheet_dir');
    function wpse62567_stylesheet_dir($stylesheet_dir_uri, $theme_name){
        return $stylesheet_dir_uri . '/new-dir';
    }
share|improve this answer
    
That's already in place in my theme but does not solve the problem. You still need a style.css sheet in the primary theme directory. add_filter('stylesheet_directory_uri','fsol_dir_uri',10,2); function fsol_dir_uri($stylesheet_dir_uri, $theme_name){ $subdir = '/scss'; return $stylesheet_dir_uri.$subdir; } –  voodooGQ Aug 21 '12 at 22:23
    
Sorry for all the edits to the comment, can't get the code block to work for some reason. –  voodooGQ Aug 21 '12 at 22:31
    
Even with that in place the admin panel will say its a broken theme if it doesn't have one in the root directory. –  voodooGQ Aug 21 '12 at 22:36
    
Ohh, we'll need at-least a blank style.css file with theme name in theme directory. –  amit Aug 21 '12 at 22:39
    
Exactly. That's the issue I'm trying to get around at the moment. Is there a way to tell WP to check elsewhere for the Theme Header information? Seems like something so simple. I haven't went head deep into the core yet but it has to say somewhere to check X/X/X for the Theme Header info. –  voodooGQ Aug 21 '12 at 22:43
show 1 more comment
up vote 0 down vote accepted

Answered by @Vino here: http://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 is final. You can edit at your peril, 'cause updates to WP will overwrite your efforts."

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.