Closed jedrzejchalubek closed 4 years ago
Wordpress do not provide an easy way to achieve that for now. We hold with this one until https://core.trac.wordpress.org/ticket/13239 lands.
I have been putting my controllers/page templates in a /controllers folder. Obviously have to leave out the main ones like "header.php, footer.php" etc. that WP needs to function, but additional templates can easily be moved which helps.
ie. themes/controller-templates/page-custom-post.php
Thanks for joining the discussion.
Moving only a part of files will cause more confusion than introducing a better organization. This is why I want to hold on. Of course, it is up to you if you are ok with that.
Rewriting paths (the way how roots/sage done it) sometimes produces strange behaviors which I want to avoid.
Move files like
header.php, footer.php, 404.php etc.
to separate/controllers
folder.Use roots/sage trick to tell WordPress where to find these files https://github.com/roots/sage/blob/9.0.0-alpha.4/functions.php#L14-L37