WordPress.org

Ready to get started?Download WordPress

Forums

Changing bg image for section of site while in About & Archives pages (1 post)

  1. eerbes
    Member
    Posted 1 year ago #

    I have a section of my site (#primaryContent) where I want the background to change when I switch to any WordPress page (ie "About" or "Archives"). Here is the ID as it appears in my style sheet:

    #primaryContent {
    	clear:both;
     	float: left;
    	margin: 0 40px 0 0;
    	padding: 10px 15px 25px 15px;
    	width: 680px;
        background: #aa854e url(images/bg-dark-folder.jpg) repeat 0 0;
    }

    Here is the code I added just below the if (have_posts()) : while (have_posts()) : the_post();?> line in my page.php file:

    <style type="text/css">
    	   #primaryContent {background: #eee5dc url("images/bg-updates.jpg") repeat 0 0;}
    </style>

    This method only changes the color of the section to #eee5dc, the background image bg-updates.jpg does not appear.

    I know the file path and image name is accurate and I tried using the absolute path without success.

    Is there something I'm doing wrong? Is there another method for changing the background of #primaryContent when I open a WordPress page? Any insight in this matter is greatly appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic