0

i want to create a theme has background image that is changeable by admin.for this goal i added that code to my function.php:

$defaults = array(
    'default-color'          => '',
    'default-image'          => '',
    'default-repeat'         => 'no-repeat',
    'default-position-x'     => 'center',
        'default-position-y'     => 'fixed',
        'default-size'           => 'fixed',
    'default-attachment'     => 'scroll',
    'wp-head-callback'       => '_custom_background_cb',
    'admin-head-callback'    => '',
    'admin-preview-callback' => ''
);
add_theme_support( 'custom-background', $defaults );

but these codes changed my design which created with css.the theme is based on parallax so if css doesnt work, all theme will waste.

here is the css:

/* parallax */   #home {
  background: url(<?php get_background_image(); ?>) no-repeat center center fixed; 
  display: table;
  height: 100%;
  position: relative;
  width: 100%;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

so how can shape the function with css? thank you for your helps

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.