简体   繁体   English

WordPress主题开发-WP标准CSS类未知

[英]Wordpress Theme development - WP standard CSS classes are unknown

i created a wordpress theme including an own style.css file in the themes folder. 我在主题文件夹中创建了一个wordpress主题,其中包括一个自己的style.css文件。 When i use the theme nearly everything works as expected except the wordpress own standard classes. 当我使用主题时,除wordpress自己的标准类外,几乎所有东西都按预期工作。 For example: If i select an image with the WP image tool and select "align: center" it adds the class "aligncenter" automatically to the image. 例如:如果我使用WP图像工具选择图像,然后选择“ align:center”,它将自动将“ aligncenter”类添加到图像。 But this class will not be found by the website. 但是此类不会在网站上找到。 How can i ensure that those standard CSS classes are valid besides my own style.css of my theme? 除了主题自己的style.css之外,我如何确保这些标准CSS类有效?

Thanks. 谢谢。

You'll have to add the rules yourself, you could copy what you need from eg TwentyTwelve: http://themes.svn.wordpress.org/twentytwelve/1.1.1/style.css 您必须自己添加规则,可以从TwentyTwelve中复制所需内容: http ://themes.svn.wordpress.org/twentytwelve/1.1.1/style.css

Also, take a look at this article, listing all relevant selectors: http://digwp.com/2010/05/default-wordpress-css-styles-hooks/ 另外,请看一下这篇文章,列出所有相关的选择器: http : //digwp.com/2010/05/default-wordpress-css-styles-hooks/

You need to insert the standard WordPress Css into your main stylesheet- which can be found here 您需要在主样式表中插入标准WordPress Css,可在此处找到

http://codex.wordpress.org/CSS#WordPress_Generated_Classes http://codex.wordpress.org/CSS#WordPress_Generated_Classes

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

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