【发布时间】:2015-08-11 17:10:16
【问题描述】:
我一直在阅读关于添加自定义背景选项的 WordPress 法典,就像在这个例子中一样
$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 );
生成的输出如下所示:
<style type="text/css" id="custom-background-css">
body.custom-background { background-color: #bdd96e; }
</style>
由于我的主题的复杂性,这将不起作用,我需要能够更改上面的 sn-p 以便它将覆盖 .menu-wrapper 标签的默认背景,有什么方法可以更改默认 CSS 选择器以不同的标签而不是正文为目标?
【问题讨论】:
标签: php html css wordpress wordpress-theming