用于创建一个新的子主题文件夹,并自动生成必要的 functions.php 和 style.css 文件。
适合在需要基于现有父主题创建子主题时使用,以便安全地自定义主题功能。
| 参数 | 说明 |
|---|---|
<slug> |
新子主题的别名。 |
--parent_theme=<slug> |
要放在 style.css 的 Template: 头中的内容。 |
[--theme_name=<title>] |
要放在 style.css 的 Theme Name: 头中的内容。 |
[--author=<full-name>] |
要放在 style.css 的 Author: 头中的内容。 |
[--author_uri=<uri>] |
要放在 style.css 的 Author URI: 头中的内容。 |
[--theme_uri=<uri>] |
要放在 style.css 的 Theme URI: 头中的内容。 |
[--activate] |
激活新创建的子主题。 |
[--enable-network] |
为整个网络启用新创建的子主题。 |
[--force] |
覆盖已存在的文件。 |
$ wp scaffold child-theme sample-theme --parent_theme=twentysixteen