WordPress.org

Ready to get started?Download WordPress

Forums

Sixhours
Per page bg color (3 posts)

  1. Chris Percival
    Member
    Posted 2 years ago #

    Love the theme and chose it for it's great presentation for art work. I am using it right now for the development of a new site for my photography.

    But, I would like to change the background color on some pages. Some of the suggestions on the forum don't seem to apply, since the body tag does not appear in the page.php file.

    The header.php file seems to contain that. Do those suggestions apply here? Can you help?

    Thanks,

    Chris

    http://wordpress.org/extend/themes/sixhours/

  2. Caroline Moore
    Member
    Theme Author

    Posted 2 years ago #

    Each page (or post) has a unique ID and a class in the body tag to which you can apply individual page styles. (This applies to most themes, not just mine.)

    To get the page ID:

    Edit the page in question, then look in your browser's URL window for a string like post=1234; 1234 is the post ID and the class would be .page-id-1234

    Alternatively, you can publish the page or post in question, then open the published page in your browser and View Source. Look for the body tag and you'll see something like:

    <body class="page page-id-1234">

    Again, 1234 is the ID and .page-id-1234 is the class. You can then apply a specific style to only that page in your stylesheet like so:

    body.page-id-1234 {
       background-color: #fff;
    }

    I highly recommend creating a child theme for your changes (if you haven't already) so you don't lose your styles when the theme is updated.

  3. Chris Percival
    Member
    Posted 2 years ago #

    Thanks...I have to find the div containing the entry and change it's background to get what I wanted. The body background was not persistent, but flashed on until the div's were rendered.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags