一、子主题(Child Theme)开发入门
步骤1:创建子主题
-
在
/wp-content/themes/
下新建文件夹(如astra-child
) -
创建必需文件:
-
style.css 头部注释:
/* Theme Name: Astra Child Template: astra */
-
functions.php 加载父主题样式:
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_styles' ); function astra_child_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。 请发送邮件至:alan.tang@freightqa.com,我们将第一时间处理!暂无讨论,说说你的看法吧
-