WordPress.org

Support

Support » Themes and Templates » Cant get add_custom_background(); to work

Cant get add_custom_background(); to work

  • I am stuck at add_custom_background.

    I can change background color/image but I only want to change my index page. Currently, the changes apply on the whole page.

    I want to make the changes from WP-admin.

    How can I specify it to a specific page ?

    Edit:

    I just checked im running 3.3.1. So my version is not supported to use add_theme_support( ‘custom-background’ );

    instead I want to use add_custom_background.

    if ( is_front_page() )
    {
       add_custom_background();
    }

    Cant get it to work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi
    Forum Moderator

    @esmi

    How can I specify it to a specific page ?

    You can’t. Not using add_custom_background(). You need to make the changes using pure CSS.

    Yeah if that was so easy. Its for a friend he want to change the front page from wp-admin. So the only way is to update WP and use add_theme_support( ‘custom-background’ ); ? Or not that either ?

    esmi
    Forum Moderator

    @esmi

    That still won’t work out of the box as it’s meant to change the background for the whole site. If this is a custom theme, what you might be able to do is write a callback function for the custom background so that the CSS that is generated targets the front page only.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cant get add_custom_background(); to work’ is closed to new replies.