TLDR Do header.php, footer.php, single.php, etc. need to be in root folder when doing traditional theme development?
I’m doing classic traditional theme development (as opposed to Block-based).
Earlier this year I learnt how to build custom WP themes following the [freeCodeCamp tutorial]).
I built my own minimalist starter kit based on that tutorial. File structure looks something like this:
404.php
README.md
archive.php
classes
comments.php
dist
footer.php
front-page.php
functions.php
header.php
home.php
index.php
mix-manifest.json
node_modules
package-lock.json
package.json
page.php
screenshot.png
search.php
searchform.php
single.php
src
style.css
tailwind.config.js
template-parts
webpack.mix.js
Is it possible to reorganize my php files into subfolders without breaking methods like `get_header()`, `get_footer()` or WordPress’s automatic routing for pages like `single.php`, `search.php`, etc.?
I want to restructure my files to something similar to the TwentyTwentyFour theme but for traditional WP dev (not using Gutenberg). Something like this:
│ functions.php
│ classes
│ dist
│ mix-manifest.json
│ node_modules
│ package-lock.json
│ package.json
│ README.md
│ screenshot.png
│ src
│ style.css
│ tailwind.config.js
│ template-parts
│ webpack.mix.js
|
├───parts
│ footer.php
│ header.php
│ sidebar.php
│
└───templates
404.php
archive.php
home.php
index.php
page-no-title.php
page-wide.php
page-with-sidebar.php
page.php
search.php
single-with-sidebar.php
single.php
Is this possible?
[ad_2]