tonik / theme

Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.
http://labs.tonik.pl/theme/
MIT License
1.33k stars 140 forks source link

Move theme "controller" files from root to the own folder #16

Closed jedrzejchalubek closed 4 years ago

jedrzejchalubek commented 7 years ago

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

jedrzejchalubek commented 7 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.

msacchetti commented 7 years ago

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

jedrzejchalubek commented 7 years ago

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.