If I were going to make a WordPress theme in 2025 this is what it would look like
- PHP 69.7%
- TypeScript 16.4%
- CSS 11.3%
- JavaScript 2.5%
This is intended to be a starting point along the lines of "if I were going to make a WordPress theme in 2025, what would it looks like?"
(削除) Rollup (削除ここまで)vite for assets (in build mode)- Composer with WP core installed at
app /resourcesfor the assets (maybe outside of the theme?)theme/modulesfor components and blocksRenderandViewclasses to come back baby- Twig templating
(削除) probably (削除ここまで) - Native blocks powered by shadcn/core components maybe (Native block components
- Styles for editor distinct from styles to front end maybe? (might be more trouble than worth) (two tailwindcss processes maybe?)
- Prebuilt most used blocks
- text beside image
- image
- FAQ
- CTA
- Cards (automatic and manual)
- Heading
- paragraph
- Standfirst/Description
- Hero
- Gallery
- Quote(s)
- Slideshow
- Video embed
New block (dynamic)
- Copy
_exampleblock - Update
block.json,edit.jsxandrender.twig - Restart vite
- Add to layouts ALLOWED_BLOCKS list
New block (client)
- Copy
_exampleblock - Update
block.json,edit.jsxandrender.twig - Add
save.jsximport intoindex.jsand pass tosave: - Restart vite
- Add to layouts ALLOWED_BLOCKS list
Core block render
This isn't set up yet but roughly
- Copy
_example--overrideto core block name (e.g.paragraph/) - Update
block.json - It will render what is in
render.twig
If we were to dev server
// /build/hot
// 2. Get dev server port from hot file
// http://[::1]:5173
// 3. return dev server and path
// get_template_directory() =>
// http://localhost:5173/public/content/themes/theme/
// 4. or return local path
// build/app.css