Add custom background to div in home page

I want to have featured image on specific div on home page that could be changed in customizer. I saw in documentation custom background for body(https://codex.wordpress.org/Custom_Backgrounds) But I want to make it for specific div eg. #featured-home-image. How? $args = array( ‘default-color’ => ‘000000’, ‘default-image’ => ‘%1$s/images/background.jpg’, ); add_theme_support( ‘custom-background’, $args ); 1 Answer 1 … Read more

How to get attachment id of background image?

I’m looking for a way to get the ID of the background_image when I am using custom headers? I tired using url_to_postid like this: $url = get_header_image() $postid = url_to_postid( $url ); and $url = get_theme_mod(‘header-image’) $postid = url_to_postid( $url ); I got a null value for both, which I realized is because both get_header_image() … Read more

How WP_Customize_Background_Image_Control is supposed to work?

I’m trying to add a second background image function to my theme customizer with this code. // HTML Background Image $wp_customize->add_setting( ‘html_background_image’, array( ‘capability’ => ‘edit_theme_options’, )); $wp_customize->add_control( new WP_Customize_Background_Image_Control( $wp_customize, ‘background_image’, array( ‘label’ => __(‘HTML Background Image’, ‘TEXTDOMAIN’), ‘section’ => ‘background_image’, ‘settings’ => ‘html_background_image’, ))); But it doesn’t work. Am I missing something here? … Read more

How do I add settings to the Background Options Page?

I am developing a theme and I wanted to add some extra content to the built in background options page. I know how to use the settings API to create new theme options and settings but I can’t seem to figure out where it’s actually calling to the background page. I have searched through wp-includes/theme.php … Read more