为 ThemeCo 的 Theme X 创建一个 Wordpress 子主题
Creating a Wordpress child theme for ThemeCo's Theme X
我想为主题 X 创建一个 wordpress 子主题。
如何从主题 X 的原始样式导入 CSS?
为任何主题创建 child 主题的一般步骤:
1) 在 wordpress 的主题目录中创建一个目录:
/wordpress/htdocs/wp-content/themes/Your-child-theme
2) 在该目录中创建一个 style.css 文件。
3) 打开新建的style.css文件,添加header信息:
/*
Theme Name: Your child theme name
Author: Author name
Template: Your parent theme name
*/
4) 导入 parent 主题样式表,
在 header 之后添加 style.css:
@import url('../Your_parent_theme/style.css');
如果您的 parent 主题只有一个样式表,那么这些步骤就足够了。否则,您可以添加多个导入语句。
检查 wordpress 代码:https://codex.wordpress.org/Child_Themes
您可以在此处下载 X 的官方 child 主题:https://community.theme.co/kb/how-to-setup-child-themes/
或者您可以创建自己的,只要您随后编辑 child 的 style.css 以包含这样一行,因为 X 不会将其 CSS 存储在同一个文件:
@import url( '../x/framework/css/site/stacks/integrity-light.css');
来源:https://community.theme.co/forums/topic/child-theme-not-working/
请注意,与大多数其他主题一样,主题 zip 存档中没有打包子主题。您必须登录 Themeco's member area 才能下载它,这需要 Envato 用户名和主题购买代码进行注册。
我想为主题 X 创建一个 wordpress 子主题。
如何从主题 X 的原始样式导入 CSS?
为任何主题创建 child 主题的一般步骤:
1) 在 wordpress 的主题目录中创建一个目录: /wordpress/htdocs/wp-content/themes/Your-child-theme
2) 在该目录中创建一个 style.css 文件。
3) 打开新建的style.css文件,添加header信息:
/*
Theme Name: Your child theme name
Author: Author name
Template: Your parent theme name
*/
4) 导入 parent 主题样式表, 在 header 之后添加 style.css:
@import url('../Your_parent_theme/style.css');
如果您的 parent 主题只有一个样式表,那么这些步骤就足够了。否则,您可以添加多个导入语句。
检查 wordpress 代码:https://codex.wordpress.org/Child_Themes
您可以在此处下载 X 的官方 child 主题:https://community.theme.co/kb/how-to-setup-child-themes/
或者您可以创建自己的,只要您随后编辑 child 的 style.css 以包含这样一行,因为 X 不会将其 CSS 存储在同一个文件:
@import url( '../x/framework/css/site/stacks/integrity-light.css');
来源:https://community.theme.co/forums/topic/child-theme-not-working/
请注意,与大多数其他主题一样,主题 zip 存档中没有打包子主题。您必须登录 Themeco's member area 才能下载它,这需要 Envato 用户名和主题购买代码进行注册。