Wordpress - 删除默认样式 [英] Wordpress - Removing default styles

查看:195
本文介绍了Wordpress - 删除默认样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建我自己的Wordpress主题只是为一个页面,安全的形式。此表单看起来像它应该正常,你可以看到在这个屏幕截图 - >

$ b不幸的是,即使我已经包含了我自己的reset.css文件,WordPress继承了主题的style.css文件中的样式。请参阅这里 - > >



正如你可以看到,字体大小更小,输入字段没有得到适当的填充,身体背景应该是蓝色,但在第二个截图中是灰色的颜色,字段没有得到正确的边距等。 p>

我知道每个人都会要求代码,但在我这样做之前,我只是想知道是否有一个默认的css文件,你可以删除或修改,大多数这些样式将被包括在内。我猜这可能包括在管理栏中,给顶部的默认margin?



如果我需要添加代码,请让我知道,我会的。



谢谢

解决方案

以下是一些选项:




  • 转到 / wp -content / themes / YOUR-THEME / header.php 并移除所有样式表。

  • 前往 / wp-content / themes /YOUR-THEME/functions.php 并删除任何 wp_enqueue_style()

  • 确保样式isn由插件生成。如果是,您可以取消注册样式。以下链接解释了如何操作: http://speakinginbytes.com/2012/09 / disable-plugins-css-file /

  • 使用自己的样式表覆盖样式。确保你的样式表是最后。您可以通过以下几种方法来实现这一点 - 我建议使用对违规样式表的依赖关系使用 wp_enqueue_style()


I'm trying to create my own Wordpress theme just for a one page, secured form. This form looks as it should normally, as you can see in this screenshot -->

Unfortunately, even though I've included my own reset.css file, WordPress is inheriting styles from the theme's style.css file. See here -->

As you can see, the font size is much smaller, input fields aren't getting proper padding, the body background is supposed to be blue but is a grayish color in the second screenshot, fields aren't getting proper margins etc.

I know everyone is going to be asking for code, but before I do that, I'm just wondering if there is a default css file you can delete or modify that most of these styles would be included on. I'm guessing this might be included in the admin bar that gives default margin to the top?

If I need to add code, please just let me know and I will. I'm just assuming there are some wordpress gurus out there who already know the answer to this question.

Thank you

解决方案

Here are some options:

  • Go to /wp-content/themes/YOUR-THEME/header.php and remove any stylesheet includes.
  • Go to /wp-content/themes/YOUR-THEME/functions.php and remove any wp_enqueue_style()
  • Make sure the style isn't generated by a plugin. If it is, you can deregister the style. Here is a link explaining how: http://speakinginbytes.com/2012/09/disable-plugins-css-file/
  • Overwrite the styles using your own stylesheet. Make sure your stylesheet comes LAST. You can do this a few ways - I'd recommend using wp_enqueue_style() with a dependency on the offending stylesheet.

这篇关于Wordpress - 删除默认样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆