If your theme uses in-built custom-background
callback then you can overwrite add_theme_support
in your child theme. Yo do not need to use remove_theme_support
.
First add custom-background
support with your callback function.
$defaults_args = array(
'wp-head-callback' => 'my_custom_background_cb',
);
add_theme_support( 'custom-background', $defaults_args );
In callback function specify div
CSS class or ID
function my_custom_background_cb() {
$bg_image = get_background_image();
if ( empty( $bg_image ) ) {
return;
} else { ?>
<style type="text/css">
.your-div-class {
background: url('<?php echo $bg_image; ?>') no-repeat;
}
</style><?php
}
}
If theme printing CSS in header or using some other custom function (not using callback function) then you can remove body background image by CSS.
Related Posts:
- get_option() vs get_theme_mod(): Why is one slower?
- Adding a description to theme customizer controls
- Theme option : having the ability to select among several predefined headers
- How to create dependent field in Customizer?
- Theme Customizier sanitize_callback not working
- How to reset (clear) theme settings
- How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?
- wp_editor() fields on Theme Options Page not saving
- How do I add settings to the Background Options Page?
- Adding a checkbox to the theme customizer
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- Add a dropdown to theme customizer
- How WP_Customize_Background_Image_Control is supposed to work?
- Theme Options Panels, What are some good examples from Frameworks or Premium Themes? [closed]
- Add custom background to div in home page
- Where are a theme’s options stored and can I export them to be imported into freshly installed themes?
- Can I install Analytics before deciding on a theme?
- Display custom_background outside wp_head()
- Options Framework options not being output
- Using update_option() and get_option() is echoing escaped strings
- Two Ways Of Creating WordPress Options Pages
- Theme Options page with tabs
- WordPress Nonce and check admin referer help needed
- WordPress Customizer Typography: How to load just the unique Google Fonts?
- Outputting results from select box option in options panel
- Upload multiple images via theme options [closed]
- PHP stylesheet cannot use standard WP functions
- How do I use add_control to offer a list of all pages in the customiser?
- Display user HTML on website
- Need help understanding/coding with Settings API
- How to remove menus section from WordPress theme customizer
- Setting up a members area
- Get background color for Live Preview with Theme Customization API?
- WordPress: update_option, don’t update empty options?
- How to hook CSS file according to theme selection in the customizer section
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Change setting name in Customizer and keep the data
- Using jQuery to retrieve customizer value
- after_setup_theme, Global Variable and Theme Customizer
- How can I insert some extra validation into the theme options’ validation function using add_filter?
- How to add an alternative style sheet as a theme option?
- Disable image resizing on specific upload fields
- Put standard wordpress options into a theme options panel?
- How can I get my options in json response?
- Can i use the same sanitize function on multiple theme mod textboxes?
- Customizer – Prefix Class Extension
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- Using an if statement in the theme customizer page
- Removing \\\ from Saved Data
- Use of check_admin_referer with theme options and options.php
- WordPress custom options storing?
- Insert content between sections in WP customizer
- Add Custom Background Properties to Customizer
- WordPress admin panel framework weird layout on server side
- get option framework options returns Call to undefined function of_get_option()
- How to disable wordpress from overload my stylesheet styles with customizer styles
- Getting the ID of header image, even when set to random
- Theme Options page not saving data correctly
- How to enqueue javascript for WP Customize options sidebar?
- Getting error to display radio button value in General Settings page
- Create an Options page with two image upload fields
- Only allow site url in text field using wp_kses/wp_filter_nohtml_kses?
- Additional custom header image
- Options Theme – WordPress [closed]
- Change WordPress header color using customizer
- Settings API settings section not appearing
- Is there a function to add additional options to the Twentyeleven option page?
- Is there any way to register custom background images like header images?
- How to set a default theme option after installing theme?
- How to get of_get_option() inside the inc folder file
- Retrieve uploaded image attibutes value from option tree theme options
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- WordPress theme options framework, I can’t read them in my templates
- Color Options from Theme Customizer API not returning via get_theme_mod()
- Display and hide content using checkbox in Options Framework Theme
- How do I remove the page listing menu in the header in the Twenty Ten Theme?
- My title won’t update
- Multiple options in the options_value field of the wp_options table
- Shorter admin url for options page
- Shortcode don’t work in custom option field, any solution?
- Alignment Problem [closed]
- WP Customazation API doesn’t save the default Value
- How to customize this theme? [closed]
- WordPress Theme Settings Page
- Theme options are they necessary
- Bring page from sub menu to admin menu in option tree
- The best place of the code for creating a robots.txt file
- Customize Option Framework
- How do I display a WP Option from an array?
- Blogname and Blogdescription in Pagelines DMS Options Panel
- Can Settings API setting generate other settings?
- Cannot modify headers
- How to get functions.php to talk to options.php
- Options Framework not saving options correctly
- How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?
- Admin menus and submenus
- Theme Options Page – Select, Radio, Tabs
- WordPress Options Framework, add to main menu not appearance menu
- WordPress karma theme shortcodes not working