Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi

    Don’t understand what you are trying to do.

    You can put an if statement in your header to load a different css file or execute a different style depending on which page you are on:

    <style type="text/css">
    <?php if(is_home() || is_front_page()) { ?>
    body{
    background-image: [image for home page]
    }
    <?php } else { ?>
    body{
    background-image: [image for all other pages]
    }
    <?php } ?>

    Thread Starter jessicakirbyshire

    (@jessicakirbyshire)

    some one gave me a code using <body <?php if (is_page(‘Hope Cottage’)) { echo “id=\”hopecottage\” “; } ?>>

    ^ not too sure where to add the code
    css using this

    #hopecottage { background-url: (…); }

    Hi

    That would go in the theme’s header.php file, replacing existing <body>.

    <body<?php if (is_page('Hope Cottage')) { echo ' id="hope-cottage"'; } ?>>

    CSS
    #hopecottage { background: url(images/filename.jpg) no-repeat; }

    Thread Starter jessicakirbyshire

    (@jessicakirbyshire)

    doesnt seem to want to work which is a pain…..

    1) This stylesheet
    https://www.castleroadcottages.com/wordpress/hope-cottage/css/lightbox.css
    is being included in your file header. The filename ends in .css but it is actually a page of HTML code. That does not belong there and needs to be removed.

    Also if you have manually added the javascripts at the top of your HEAD section, it is much better if they go just before the closing /head tag rather than as the first things in the head section.

    2) The line of CSS you added had a mistake in it on my part, and you made a typo when you entered it. Also it was being applied to the wrong DIV. It needs to be
    #hope-cottage #container { background: url(images/hopebackground.jpg) no-repeat; }

    Also, the way you typed it in is incorrect. You entered
    #hopecottage { background-url:(images/hopebackground.jpg); no-repeat;

    There is not to be a semi-colon after .jpg) only after no-repeat.
    Make sure you use the revised line of CSS I included above – just copy and paste it, to prevent typos.

    Thread Starter jessicakirbyshire

    (@jessicakirbyshire)

    Hi, Ta for the information but the lightbox actually needs to be there as it is for the gallery.

    Thread Starter jessicakirbyshire

    (@jessicakirbyshire)

    Ok cheers again for that now i have an issue where its to the left and not in the centre? will i need to repeat that code for 6 castle road?
    Jessica

    Thread Starter jessicakirbyshire

    (@jessicakirbyshire)

    Its all good Now cheers It has been resolved i had to move the coding under neath the container csss
    Thanks agan for all your help I need to repeat the process with Castle road?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Adding a background without moving the Orginal’ is closed to new replies.