自定义背景可按以下方式使用:
$defaults = array(
\'default-color\' => \'\',
\'default-image\' => \'\',
\'default-repeat\' => \'\',
\'default-position-x\' => \'\',
\'default-attachment\' => \'\',
\'wp-head-callback\' => \'_custom_background_cb\',
\'admin-head-callback\' => \'\',
\'admin-preview-callback\' => \'\'
);
add_theme_support( \'custom-background\', $defaults );
示例用法:
$args = array(
\'default-color\' => \'000000\',
\'default-image\' => \'%1$s/images/testback.jpg\',
);
add_theme_support( \'custom-background\', $args );
查看源代码时的输出示例:
<style type="text/css" id="custom-background-css"> body.custom-background { background-color: #bdd96e; }
For details follow link:
输出:
谢谢