2014-09-04 32 views
1

我正在使用创作框架,我想支持我的孩子主题中的标题图像。我想改变我上传的图像的位置作为标题图像。Genesis框架 - 如何更改自定义标题CSS代码?

我加入这行代码我的functions.php中:

add_theme_support('genesis-custom-header', array('width' => 213, 'height' => 300)); 

创现在可以生成CSS代码为.site头头版内:

.site-header { background: url(http://localhost:8888/studio/wp-content/uploads/2014/09/my_logo.png) no-repeat !important; } 

我想改变此代码,因为我想申请一些其他CSS的东西到我的<header>background-position,background-size等我在官方文档中看到,我可以在add_theme_support中使用'header-callback',但它是如何工作的?我如何编写我的回调函数WP自动更改上面为.site-header生成的代码?

如果我在我的style.css文件中更改.site-header,它不会改变任何内容。它必须如上生成,但是如何?

谢谢!

回答

0

用style.css编写的CSS应该重写默认样式!你确定加价是一样的吗?

你可以尝试使用CSS值声明为主,例如

.site-header { 
    background-size: cover !important; 
} 

此外,您还可以自定义头阵列添加更多的价值“重要!”:

add_theme_support('genesis-custom-header', array(
    'default-image' => get_stylesheet_directory_uri() . '/images/logo.png', 
    'default-color' => 'efefe9', 
    'header_image' => '', 
    'header-selector' => '.site-title a', 
    'header-text'  => false, 
    'height'   => 115, 
    'width'   => 960, 
)); 

和风格您的标志是:

.site-header .site-title a { 
    //your css here 
} 

请注意,如果您使用的是儿童主题(如I认为)

希望它有帮助;) Francesco

相关问题