【发布时间】:2014-09-04 17:29:59
【问题描述】:
我正在使用 genesis 框架,我想在我的子主题中支持标题图像。我想将我上传的图像的位置更改为标题图像。
我在我的functions.php中添加了这行代码:
add_theme_support( 'genesis-custom-header', array( 'width' => 213, 'height' => 300) );
Genesis 现在为首页中的 .site-header 生成 css 代码:
.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,它不会改变任何内容。必须如上生成,但是如何生成呢?
谢谢!
【问题讨论】: