The custom header feature allows (in some code I have found) to suggest several default images to use in the custom header.
Could the same be built in the custom background?
The idea is to have already some textures available for the user to choose from in the theme.
Any ideas?
if you are asking default background image for
add_theme_support( 'custom-background');
then it can be set using'default-image' => get_template_directory_uri() . '/images/pattern.png',
complete code will look like below.
I would suggest outputting a line of CSS in your header.php file, something like
I’m not really sure what you’re asking, but here goes.
Assuming that you already know the options settings api, here’s a form you can use to implement that idea:
http://jsfiddle.net/58sWX/
Convert that using the settings API, then use
get_option()
to retrieve your background image url to display it.If you want to change the CSS,
background: url()
, based on the option value. Then you might need to know how to use CSS in PHP.