简体   繁体   English

如何删除父主题生成的样式?

[英]How do I delete styles generated by a parent theme?

I create a website on Wordpress using a child theme.我使用子主题在 Wordpress 上创建了一个网站。 This is a child of the twentent theme.这是 twent 主题的子主题。 Sorry, but the site inherits the styles that I found in the .抱歉,该站点继承了我在 . I found this using the browser development tools.我使用浏览器开发工具发现了这一点。 These styles add a pink background to all .svg icons, eg the search icon.这些样式为所有 .svg 图标添加粉红色背景,例如搜索图标。 Or it changes the color of the headings.或者它会改变标题的颜色。 I would like to remove this effect, but I don't know how.我想删除此效果,但我不知道如何。 Can anyone help me with this?谁能帮我这个?

In another thread I read that these can be styles generated by the theme customizer.在另一个线程中,我读到这些可以是主题定制器生成的样式。 Is there a way to turn this off in a child theme?有没有办法在子主题中关闭它?

Below I attach the link to the screenshot.下面我附上截图的链接。 Turning off this style sheet in the browser I get the effect I wanted, ie all headers and icons have the color that I defined in my style.css在浏览器中关闭这个样式表,我得到了我想要的效果,即所有标题和图标都具有我在 style.css 中定义的颜色

在此处输入图片说明

Either you should check if the colors can be changed in the Customizer (which shouldn't be that hard).您应该检查是否可以在定制器中更改颜色(这应该不难)。

Or try to override the styles of the parent theme in the child's style.css或者尝试在孩子的 style.css 中覆盖父主题的样式

You can do this by copying the lines used in the parent theme and then changing the settings inside the { } and adding that to the child style.css.您可以通过复制父主题中使用的行,然后更改{ }的设置并将其添加到子 style.css 中来完成此操作。 Because your child theme style.css (should be) is included after the parent theme style.css, this should automatically override the parent theme style.因为您的子主题 style.css(应该是)包含在父主题 style.css 之后,这应该会自动覆盖父主题样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM