• I like to have one stylesheet in the root of my site, and every page refers to this one. When I create a ‘theme’ for my own use it won’t let me unless I copy the stylesheet in there. I don’t like having to spread multiple copies of the stylesheet over my site.

    edit: ofcourse I can place an empty stylesheet in there, but the theme manager then will take that for editing.

Viewing 15 replies - 1 through 15 (of 18 total)
  • Why not just move the style sheet to the templates directory and use that everywhere using then use the:

    ‘<?php bloginfo(‘stylesheet_url’); ?>’

    Directive to call the stylesheet?

    Thread Starter dissurion

    (@dissurion)

    Interesting reply. But not all my pages are wordpress pages. Also, if you have multiple blogs installed, you still need multiple stylesheets.

    What about changing the template page code to do the @import of the CSS to the root path? You can put a stylesheet anywhere you like, as long as you tell the pages where to find it.

    Thread Starter dissurion

    (@dissurion)

    If I understand you correctly, that’s what I have now. I have my style.css somewhere for all my pages. But the theme manager requires me to have a css page inside my theme. So I’ve put in a bogus css file to satisfy it. Ofcourse, when I use the theme manager to change the css file it takes this one and changes one that actually does nothing, instead of taking my actually used one.
    So, my suggestion for this beta build is to accept a theme without a stylesheet in the directory, and maybe just taking a look at the files in there where the actually used stylesheet is.

    Ah, okay, I understand what you are saying now. It’s because the theme system relies on a block of text at the top of the CSS file to identify itself as a theme. Some have requested that this be dumped out to a text file instead, thus removing the dependency of the CSS file.

    I personally think that the theme information should be in its own distinct file, and not be part of the CSS.

    That said, can you not do this:
    Leave the theme CSS file, but wipe it out, save for the necessary theme info at the top. Then, in the theme pages, like header.php, edit the <head> to have an @import with the path to your desired style sheet.

    This is just an untested guess. I’ll check later to see if I can do this myself.

    Once upon a time, the theme information was in separate, ini formatted file. Then there were requests to put the information in a comment at the top of the stylesheet — plugin style. I switched it over and all was well. But wait, now there are requests to go back to the former style. Nobody is ever happy. ?? At this point, things are staying as is. Mr. Moose’s suggestion is a good one.

    Thread Starter dissurion

    (@dissurion)

    I don’t care where everyone like to stick his/her theme information. =) And I am happy with the solution I have now for myself. But I don’t think the solution that is implemented is the most logical:
    1) if you like to have one stylesheet on a site with non-wordpress pages you have to trick wp into believing you have a full theme
    2) that also means the theme editor becomes obsolete for the stylesheet
    3) people are forced to create an external stylesheet in the first place

    I’m not suggesting anything about theme info here (didn’t even know that existed :), but I do think a theme without a (external or none at all) stylesheet should still be recognized as a theme. This has little to do with themeinfo.

    Dissurion,
    How do you then “tell” WordPress that there is a theme available if there isn’t some kind of hook into the admin panel? There needs to be some kind of setup for this to happen.

    rboren,

    I was not aware that there was a hew and cry over the theme information. Frankly, using the style sheet to supply this kind of information goes against the philosophy of using the right tool for the job. The style sheet is about presentation, not about making components of an application work together. I guess I should not have unsubscribed from the dev mailing list, and maybe I would have seen this discussion going on.

    What makes a theme a theme is the presence of a stylesheet. Those integrating WordPress with non-WordPress managed files probably shouldn’t bother with the theme system as it will just get in their way.

    Thread Starter dissurion

    (@dissurion)

    Actually, while creating my “theme” (just an index file) I was presuming that themes were recognized by their folders. A folder = containing a theme. I just know now that isn’t the case but it is done through theme info.
    I think WP should leave the user alone with a non-description if no info or stylesheet is provided (as in plugins when no description in the plugin).

    Thread Starter dissurion

    (@dissurion)

    @rboren:

    if people install 2+ WP versions (for eg different bloggers) and want to use one stylesheet they would have the same problem: create a stylesheet for every blogger and updating every one of them after changes, or trick the theme manager.

    A theme can be recognized by just its folder if no theme header is provided in the stylesheet. Currently, a theme is considered broken if it doesn’t possess a stylesheet. This was added to address a common support issue, but perhaps it could be reconsidered.

    Yes, the theme system isn’t really suitable for sites with non-WP pages and so I assume in the final release there’ll be a commented-out piece of code in index.php for switching it off ??

    You can turn it off by setting $wp_template_redirect to false before including the blog header.

    $wp_template_redirect = false;
    require('./weblog/wp-blog-header.php');

    Currently the default index.php looks like this:

    <?php
    /* Don't remove this line. */
    require('./wp-blog-header.php');
    ?>

    That’s the whole thing. Adding a commented out wp_template_redirect line wouldn’t be terribly useful since uncommenting it would result in a blank page being served up.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘allow themes without stylesheets’ is closed to new replies.