• I’m using WP 2.6.5 with the Painter Theme

    The Painter theme allows for custom colors through Dashboard –> Design –> Custom Colors, but how do I edit the actual CSS to include background images instead of colors? The “style.css” does not display color options.

    I can however, use the browser’s View –> Page Source function to see the colors CSS, apparently embedded into the head of the page’s html. Example: <style type=”text/css” media=”screen”>
    #container
    {
    border-color:#cc0000;
    background-color:#c0c0c0;
    }
    ect…, I just can’t find where to edit this code?!?!?

    Website is http://metalmusicpromotions.com/index.php

Viewing 1 replies (of 1 total)
  • Hi

    I wasn’t familiar with that theme but just downloaded it to look at its code. The default CSS is all included in file /inc/custom-colors.php.

    The problem with editing that file directly is that whenever that theme is updated, the changes may overwrite your file that has been customized.

    As you said, the theme is writing its CSS directly into the header of the page. It is not using the stylesheet to do so, which makes it more difficult to modify.

    I will give you an example of how you can change the background and override the theme’s default styling in your stylesheet.

    Lets say you want to apply an image to what is presently the solid black background of the post background area.

    The present styling applied to that area is this
    (found on index.php line 125):

    #highlight, .post, .comment, .pingback, .comment-form {
    background-color:#000000;
    border-color:#000000;
    color:#C0C0C0;
    }

    That background is applied to a div, class=”post”. The rules of CSS are that when more than one piece of styling is applied to one page element, the most specific assignment “wins”, when they are in conflict. The theme author has made his styling assignments very general, so they are easy to override.

    In this case all you need to do is make an entry in style.css like this
    #content .post { background: url(images/myimage.jpg); }
    and put the image in /wp-content/themes/{themename}/images/myimage.jpg

    We are applying a styling rule to class post but only when that class is within a block that starts with the div id=”content”. That is more specific than the theme’s built in, which is applied to an element in class post regardless of what containing block post is in.

    That the only block within which the class post exists in the whole page is already the div content is irrelevant. #content post is still more specific than just .post so the styling assigned to it will override the styling in the theme header.

    If you find you are not able to figure out what CSS code will be more specific than the theme’s styling code for a section of the theme you want to assign a background image to, then post back here where exactly you want to do that.

Viewing 1 replies (of 1 total)

The topic ‘Painter Theme CSS’ is closed to new replies.