Viewing 11 replies - 1 through 11 (of 11 total)
  • Go into your header.php and change

    <body>

    to

    <body <?php body_class(); ?>>

    You will now have a unique class on every page, allowing you to target a page with your background colour. After you’ve added the code and uploaded it, look at your page source to find the class and adjust your CSS accordingly.

    Thread Starter mikehende

    (@mikehende)

    Not sure I understand? I want to have one universal background color? Are your instructions for this purpose? Just double checking to make sure you understand what I am asking? Thanks.

    Moderator cubecolour

    (@numeeja)

    So you want to replace the black background on all pages with the same colour?

    If that is your goal, you need to edit the stylesheet in your theme style.css. Near the top you’ll see a block:

    body
    {
    	margin: 0 auto;
    	padding: 0;
    	background-color: #050505;
    }

    Change the value on the last line – to the value you want for the background colour so for a dark blue it would be:

    background-color: #000066;

    If all you want to do is set one general background colour for all your pages, follow cubecolour’s instructions.

    Thread Starter mikehende

    (@mikehende)

    YES, that’s it, thanks!

    what code do you use if you want white as the background colour?

    Thread Starter mikehende

    (@mikehende)

    oh, didn’t notice this, the background color shows all around the outside of the template, I would like to have the inside background where all of the content is to be another color, how can I do this please?

    https://pcandnetservices.com/wordpress/

    Moderator cubecolour

    (@numeeja)

    what code do you use if you want white as the background colour?

    the hex code for white is #fff

    Moderator cubecolour

    (@numeeja)

    experiment with applying similar rules to the css for these strangely named elements

    artsheet
    artsheet-body
    art-contentLayout

    However you’d be better off starting with a better theme – the one you have used is pretty awful. If you want to use a free theme you should use a GPL one from the theme repository as those are checked & tested and don’t put advertising links in your footer or other nasties.

    Thread Starter mikehende

    (@mikehende)

    I had wanted a 3 column layout which is why I chose the one I have, I could find one in the twenty ten or other options. before I try the CSS for those elements you have mentioned, I need to get rid of those light blue colored bars with the arrow in those 2 div’s, can you tell me exactly which code I should remove form the leftsidebar please?

    Moderator cubecolour

    (@numeeja)

    Install the web developer toolbar in firefox & use the outline current element to find class & id names of your elements, and the edit css function to try out css changes before making any changes on the server.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to add background color main page using php?’ is closed to new replies.