WordPress.org

Forums

Manually Changing Custom Background in Twentyten (8 posts)

  1. michaeltveenstra
    Member
    Posted 4 years ago #

    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?

  2. Root
    Member
    Posted 4 years ago #

    this is for the body bg ?

    in style.css do

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

  3. michaeltveenstra
    Member
    Posted 4 years ago #

    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.

  4. Root
    Member
    Posted 4 years ago #

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

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    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.

  6. Root
    Member
    Posted 4 years ago #

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

  7. esmi
    Forum Moderator
    Posted 4 years ago #

    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.

  8. alchymyth
    Forum Moderator
    Posted 4 years 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; }

Topic Closed

This topic has been closed to new replies.

About this Topic