• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Add Support For Custom Background Image

Some themes already include support for adding a custom background image or background color.

custom background

If your theme doesn’t include this page, you can add it simply by adding this code in your child themes functions.php file.

The code assumes you have uploaded a default image named bg.png to your child themes images folder.

Here’s the basic code without any parameters:

Related Posts

  • How To Remove Custom Background Image

Reader Interactions

Comments

  1. solar says

    November 3, 2014 at 11:04 am

    I added this in my Magazine pro theme functions.php

    add_theme_support( 'custom-background' );

    and background option came but now when I upload image via this option ,it does not stretch ,I am using 960px x 760px image ,I don’t want to do this via this option as it is not changeable through background under appearance ,any help would be appreciated

    add_theme_support( 'custom-background', array(
    	'default-image' => get_stylesheet_directory_uri() . '/images/bg.png',
    	'default-color' => 'f3f3f3',
    ) );
    Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.