WordPress 3.0: Activating the Background Editor
by c.bavota | Posted in Tutorials | 17 comments
Adding a color or image to your Web site’s background is not a very complicated thing to do if you are familiar with CSS. Luckily for those out there who know nothing about CSS, WordPress 3.0 introduces a simple admin user-interface that makes it extremely simple to select a color or image for your background. There are even controls for image position, repeating and attachment.

The new background editor in WordPress 3.0
Activating the background editor only requires that you add one line of code to your theme’s functions.php file.
if(function_exists('add_custom_background')) add_custom_background();
This will add the “Background” link to your Appearance panel in the wp-admin. Placing it inside the function_exists() function makes it backwards compatible in case someone uses your theme with WordPress 2.9.



I broke my site trying to probe your tip,
I was working with wordpress 2.9 and I decided to update the new 3.0 version. My theme was the magazine basic 2.4. Everything was good till I tryed your tip in the css area. I wrote the piece of code but the error occurred ,I have though in buying the premium version, although I dont know If it is possible to recover somethig of the stuff that was lost. What should I do? I can’t use the admin panel.
Can I fix it again from the hosting archive.
I suspect that my partners are going to kill me.
You are not suppose to add it to the CSS area, you are suppose to add it to the
functions.phpfile.I am looking in the ftp files of my hosting… Do you know in which file of the css files should I check to fix the error? As far as I remember I changed something in the Sidebar
if(function_exists ((…)) Can you tell me which file should I correct?
Thanks in advance
The problem is that:
Parse error: syntax error, unexpected ‘)’ in /homepages/40/d280195945/htdocs/wp-content/themes/Newspaper classic/functions.php on line 895
I suggest just installing the latest version of Magazine Basic which has this functionality incorporated into it.
Will this work still OK with the newer versions like WordPress 3.1.1?
Thanks for this tip – I have struggled changing backgrounds on some of my Word Press sites. I like the look of your WP themes!
Gina
Not useful to my own sites since I would much easier update the css myself when I want to do that, but this is great for my clients who want this ability and Now I don’t need to program it.
Thanks,
Mike
This is a pretty simple way to change the background image. Thanks.
Wonder why WordPress doesn’t contain this code OOB?
It can’t be OOB since it relies on how theme developers want their themes to function. I think they should all include it but some have custom functions that do that same thing.
Thanks for taking the time to explain this, it should be quite useful as i am in the process of changing some of my sites over to wordpress.
Been using xsitepro for a long while but thought it would be good to vary some of them and wordpress seems the easiest option, especially when there are people like yourself willing to share tips and work arounds.
Steve Peters
Webmaster inu-dogcare.com
All about the shiba inu
This takes all of the stress out of changing background colors. I welcome any and all tools to make my life a little easier- thanks for the heads up.
Thank you C.Bavota!
You have made it easy to customize backgrounds. I will make sure to remember this and utilize it when I need to change or alter or revamp my own site.
Along with the info that you have already provided, can you please give a lead on how to alter fonts and if there is a way to introduce fonts that are not available. As in, is there a way to download different fonts and all?
Brett Michael Williams
Webmaster, AZBMW
Read this: http://bavotasan.com/articles/great-font-resources/