WP CLI说明文档

wp scaffold child-theme

命令概述

用于创建一个新的子主题文件夹,并自动生成必要的 functions.phpstyle.css 文件。

适合在需要基于现有父主题创建子主题时使用,以便安全地自定义主题功能。

参数列表

参数 说明
<slug> 新子主题的别名。
--parent_theme=<slug> 要放在 style.cssTemplate: 头中的内容。
[--theme_name=<title>] 要放在 style.cssTheme Name: 头中的内容。
[--author=<full-name>] 要放在 style.cssAuthor: 头中的内容。
[--author_uri=<uri>] 要放在 style.cssAuthor URI: 头中的内容。
[--theme_uri=<uri>] 要放在 style.cssTheme URI: 头中的内容。
[--activate] 激活新创建的子主题。
[--enable-network] 为整个网络启用新创建的子主题。
[--force] 覆盖已存在的文件。

常用示例

基于 TwentySixteen 生成子主题

$ wp scaffold child-theme sample-theme --parent_theme=twentysixteen