• Hello people,

    I have a question about stylesheets. I’ve put the CSS files from my theme in the /CSS directory. In my header.php file I’ve hard-coded the URL to the stylesheet like so:

    <link rel="stylesheet" href="<?php echo bloginfo('template_directory'); ?>/css/stylesheet.css" type="text/css" media="screen" />

    This works fine as long as I don’t open the template manager in the backend. As soon as I do that WordPress reverts to the standard theme because it thinks the stylesheet of my theme is broken (which makes sense: I have no style.css file in my theme directory).

    How do I change the stylesheet URL so that the backend sees my stylesheet?

    Thnx in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter nielskreijveld

    (@nielskreijveld)

    I found a workaround. You place a style.css file in your theme’s main directory, and you keep your code in your header as mentioned above. This way the backend thinks you are using style.css, and it doesn’t revert to the classic theme. It’s a bit silly, because you need one additional file to make it work, so I would rather have a more elegant solution.

    Can anyone help me?

    My question is… why do you want the stylesheet somewhere other than the theme folder?

    Thread Starter nielskreijveld

    (@nielskreijveld)

    Organisation… Javascript in the /js folder, flash in the /flash folder, css in the /css folder. I’ve been building websites with that structure for ages, I am a neat freak…

    Thread Starter nielskreijveld

    (@nielskreijveld)

    And the /css folder is still in the theme folder :).

    I’m trying to find the same solution. I usually put my CSS code in a CSS folder as well and would like to keep it that way.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom stylesheet URL?’ is closed to new replies.