Support » Themes and Templates » Manually Changing Custom Background in Twentyten

  • Hello all, I’ve been working with the twentyten theme on the blog I’m starting up, and the server I’m hosting it through has php safe mode on, so I can’t use the in-browser image uploader for the custom background function. I’ve added the file via FTP to the themes images directory, but I can’t find existing code referencing a background image. I know there’s a way to add it manually, I just don’t know what file to put it in or what code to edit.

    Anyone have any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • this is for the body bg ?

    in style.css do

    body {background: #ccc url(‘path-to-bg.png’) no-repeat; }

    Tried that, it’s not changing anything. Even changing the hex code of the background color doesn’t affect it. I tried disabling the custom background function in functions.php but that just kills the color I had there, it doesn’t put it back to the style.css setting.

    You might not be seeing yr changes. Do a hard refresh of yr browser ctrl + f4 in Windows i think

    esmi

    (@esmi)


    Forum Moderator


    Don’t edit the Twenty Ten theme! Your customisations will be over-written the next time you upgrade WordPress or the theme. For this reason, it is recommended that you consider creating a child theme for your customisations.

    Twenty Ten uses a customisable background via add_custom_background(); via the twentyten_setup() in functions.php, So you would need to rewrite this function on your child theme to remove custom background support.

    it is just so irritating that basic css is now being hard coded into php functions. it just aint right.

    esmi

    (@esmi)


    Forum Moderator


    I think you’ll find that the old Kubrick theme was generating its header css via the custom header function quite a few versions ago.

    because twenty ten is writing the style for the body background as an embedded style into header.php, this will overwrite any body background style in style.css, unless you use the !important to force these styles:

    try in style.css:

    body {background: #ccc url('path-to-bg.png') no-repeat!important; }

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Manually Changing Custom Background in Twentyten’ is closed to new replies.