WordPress.org

Ready to get started?Download WordPress

Forums

put kubrick image info into css file (6 posts)

  1. Rob Poitras
    Member
    Posted 9 years ago #

    I really just need to put the header file info into the sytle.css file.

    I tried taking the #header & #headerimage code out of the header file and putting it into the css file. But Im not sure where exactly to put it and what code to take out of the header file and put in to the css file.

  2. lyklev
    Member
    Posted 9 years ago #

    You simply can't put the header code into the css-file. The header is php-code, and is actually a small program, while the css is just css and will never get executed.

    The problem is that in your css you need the complete url of the image, wordpress directory and probably hostname too. The code in the header.php does this for you.

    If you want to do a css-only image, that is ok as long as you put the complete path (including the path to the theme directory) in your css. This makes it impossible to package your theme as a bundle and put it on another site, which is the reason it was not put in the css.

  3. Rob Poitras
    Member
    Posted 9 years ago #

    that makes sense. reason I ask, im trying to have a header image based upon what category is being displayed.
    Changing the css files seemed easier than switching header files.

  4. Root
    Member
    Posted 9 years ago #

    What would happen if you made sure the image was in your theme directory. Or you just used a relative path ?

  5. Rob Poitras
    Member
    Posted 9 years ago #

    it should be fine. i know people that use css to point their sidebar image backgrounds.
    like the background for pages, categories, meta, etc...

  6. Root
    Member
    Posted 9 years ago #

    I have never understood why that code is in the index.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.