Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying with no luck to change the background color of just one page. I've tried adding > and then using the selector

body.page-id-15 #content { background-color:#000000; }

This doesn't work. Seems the only way I can change the background to that page is changing the background of #content. But...that changes all pages. I know this is possible and I've done it before. But not with this theme

Any ideas? The link the page in question is here http://gregtregunno.ca/news Thanks

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Looking at your pages source, it does not have post/page ID's being added to the page's body class so you referencing something in your CSS that doesn't exist.

Try this rather (not sure what section you want changed):

body.blog {
    background-color: red;
}

or

body.blog #content {
        background-color: red;
    }
share|improve this answer

You could put some conditional code in the header.php file that inserts a style into the header only for your specific page ID (15 in the example):

<head>
<?php if(is_page(15)): ?>

<style>
body.page {background-color: #FF0000 !important;}
</style>

<?php endif; ?>
</head>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.