wp-theme-authoring
WordPress工具/wp-theme-authoring
29 files
316.2 KB
3 downloads
File List
| File | Size | |
|---|---|---|
| SKILL.md | 10.8 KB | Download |
| references/01-技术栈与项目结构.md | 13.7 KB | Download |
| references/02-样式与构建.md | 12.2 KB | Download |
| references/03-布局与模板骨架.md | 21.2 KB | Download |
| references/04-能力模块清单.md | 14.5 KB | Download |
| references/05-代码片段库.md | 49.5 KB | Download |
| references/06-SEO与Yoast集成.md | 23.9 KB | Download |
| references/07-性能安全与部署.md | 45.7 KB | Download |
| references/08-AI执行清单.md | 13.9 KB | Download |
| references/09-开工提示词模板.md | 6.2 KB | Download |
| templates/404.php | 4.0 KB | Download |
| templates/archive.php | 2.2 KB | Download |
| templates/assets/css/src/main.css | 1.8 KB | Download |
| templates/assets/css/theme.css | 7.4 KB | Download |
| templates/comments.php | 3.2 KB | Download |
| templates/footer.php | 4.4 KB | Download |
| templates/functions.php | 6.6 KB | Download |
| templates/header.php | 4.0 KB | Download |
| templates/inc/comments.php | 9.7 KB | Download |
| templates/inc/config.php | 3.8 KB | Download |
| templates/inc/seo.php | 11.6 KB | Download |
| templates/index.php | 1.9 KB | Download |
| templates/package.json | 1.1 KB | Download |
| templates/page.php | 2.5 KB | Download |
| templates/search.php | 1.7 KB | Download |
| templates/single.php | 6.4 KB | Download |
| templates/template-parts/post-list.php | 4.1 KB | Download |
| templates/打包命令.md | 13.1 KB | Download |
| templates/部署文档模板.md | 15.0 KB | Download |
WordPress 主题编写规范(wp-theme-authoring)
定位:一套可直接交给 AI 或开发者执行的 WordPress 经典 PHP 主题编写规范 + 骨架模板。 形态:技能包(
SKILL.md+references/九册规范 +templates/可复制骨架) 适用范围:wp-content/themes下的主题代码、functions.php、模板层级、主题样式改造与上线打包。
0. 一句话说明
把「经典 PHP 主题 + Tailwind CSS 4 + daisyUI 5 预编译」锁死为唯一实现路径:新建主题、加页面、改布局、补 SEO、打包上线,都照这里的规范与骨架抄,不引入其它范式。
明确不做:FSE / 区块主题、theme.json、templates/*.html。
1. 技术栈锁定
| 项 | 锁定值 |
|---|---|
| 主题类型 | 经典 PHP 主题(非 FSE / 非区块主题) |
| WordPress | ≥ 6.5 |
| PHP | ≥ 7.4,mbstring 必需 |
| 样式 | Tailwind CSS 4(4.3.3)+ daisyUI 5(5.7.38) |
| 构建 | Node 仅构建期需要(npm run build:css) |
| 运行期 | 前台不依赖 Node、不依赖 WindPress,无首屏样式闪烁 |
2. 文件清单
wp-theme-authoring/
├── SKILL.md 技能入口:定位、技术栈、结构速查、索引
├── references/ 规范主体(按需查阅)
│ ├── 01-技术栈与项目结构.md
│ ├── 02-样式与构建.md
│ ├── 03-布局与模板骨架.md
│ ├── 04-能力模块清单.md
│ ├── 05-代码片段库.md
│ ├── 06-SEO与Yoast集成.md
│ ├── 07-性能安全与部署.md
│ ├── 08-AI执行清单.md
│ └── 09-开工提示词模板.md
└── templates/ 可直接复制到新主题的骨架
├── functions.php / header.php / footer.php
├── index.php / archive.php / search.php / single.php / page.php / 404.php
├── comments.php
├── inc/(config.php / comments.php / seo.php)
├── template-parts/post-list.php
├── assets/css/(theme.css / src/main.css)
├── package.json
├── 打包命令.md
└── 部署文档模板.md
3. 怎么用
- 先读
SKILL.md:确认技术栈、目录结构与 references / templates 索引。 - 新项目开工:用
references/09-开工提示词模板.md一次性交代需求(项目、环境、页面、内容类型、能力模块、SEO、交付要求)。 - 动手前 / 交付前:过一遍
references/08-AI执行清单.md的三段清单与禁止事项。 - 搭骨架:按
SKILL.md第五节的「落地位置」表,把templates/里的文件复制到新主题对应路径。 - 改样式:只改
assets/css/src/main.css,然后npm run build:css产出assets/css/tailwind.css;不要手改编译产物。 - 打包上线:按
templates/打包命令.md排除node_modules与工作物料,按templates/部署文档模板.md写部署说明。
4. 最容易写错的地方
- 文章详情页是「左栏正文 + 右栏 sticky 侧栏(
lg:row-span-2)+ 左栏评论区」,lg以下按 DOM 顺序退化为单栏。 - 每页只允许一个
h1,标题层级与容器宽度见references/03-布局与模板骨架.md。 comments.php/single.php/post-list.php依赖inc/comments.php,必须一并复制。inc/seo.php与 Yoast 的职责边界见references/06-SEO与Yoast集成.md,不要重复输出。
5. 说明
本目录是技能包的展示 / 下载副本,原件位于开发仓库的 wordpress插件/wp-theme-authoring。原件更新后,重新覆盖本目录即可。
This program is provided solely for security research, principle analysis, and defensive capability building. Do not use it for any unauthorized attack, fraud, or other illegal activity. Before downloading or using it, confirm that you comply with the laws of your jurisdiction and the terms of service of any target platform. You bear all risks.