• Resolved pullman

    (@pullman)


    Hi everybody

    I am having trouble adding a background image to my contact page:

    https://philipus.com/contact

    I want it behind the contact form. I’ve tried adding the background image property to the “container-inner”, which would cover exactly the area I want covered.

    But the problem is that the image then appears on the front page, which has a gallery (the image will be behind the gallery but 10px or so of the background image will be visible below the gallery).

    How can I get the background image only to appear on the Contact page?

    Thanks a million
    /p

Viewing 8 replies - 1 through 8 (of 8 total)
  • more information please

    Thread Starter pullman

    (@pullman)

    Thanks for quick reply – and apologies, I accidentally pressed “post” before i was done.

    My second question is how I make the contact form – which is a cForm – transparent (except the text fields).

    Thanks again
    /p

    insert this condition just before the </head> tag in header.php:

    <?php
    if(is(page('contact')) :
    echo '<style type="text/css" media="screen">
    .container-inner {
    background:#FFF url('.get_bloginfo('template_url').'/images/contact_bg.jpg) left top no-repeat; }
    </style>';
    endif;
    ?>

    you can fine tune the background position by using positive or negative px values instead of ‘left’ and ‘top’.

    to get the backgrounds in the form transparent:
    https://philipus.com/wp-content/plugins/cforms/styling/wide_form.css

    .cform fieldset	{
    	margin-top:10px;
    	padding:10px 0 10px 0;
    	border:1px solid #9d9d9d9;
    	border-left-color:#9d9d9d;
    	border-top-color:#9d9d9d;
    	background:transparent;
    }
    .cform label {
    	width:200px;
    	margin:0px 10px 0 0;
    	text-align:left;
    	font-size: 10px;
    	display:block;
    	color:#888888;
    	background:transparent;
    	padding:2px;
    }
    Thread Starter pullman

    (@pullman)

    Thanks for this. When i insert the condition, I get the following error:

    Parse error: syntax error, unexpected ':' in /home/philipu/public_html/wp-content/themes/f8-lite/header.php on line 43

    And when i remove the : I get:

    Parse error: syntax error, unexpected T_ECHO in /home/philipu/public_html/wp-content/themes/f8-lite/header.php on line 44

    my bad – typo:
    should read is_page('contact')

    <?php
    if(is_page('contact')) :
    echo '<style type="text/css" media="screen">
    .container-inner {
    background:#FFF url('.get_bloginfo('template_url').'/images/contact_bg.jpg) left top no-repeat; }
    </style>';
    endif;
    ?>
    Thread Starter pullman

    (@pullman)

    You’re a wizard – thank you!

    Just so I understand: that condition sort of “separated out” the contact page for the purposes of the background within the container-inner?

    Thanks once again
    /p

    Thread Starter pullman

    (@pullman)

    Thanks very much!
    p

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Trouble adding background image’ is closed to new replies.