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


Comments

2 responses to “Add Support For Custom Background Image”

  1. […] you've added a custom background image using the Custom Background page under your Appearance menu it will display on every page of your […]

  2. I added this in my Magazine pro theme functions.php
    [code]
    add_theme_support( ‘custom-background’ );
    [/code]
    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
    [code]
    add_theme_support( ‘custom-background’, array(
    ‘default-image’ => get_stylesheet_directory_uri() . ‘/images/bg.png’,
    ‘default-color’ => ‘f3f3f3’,
    ) );
    [/code]

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.