Comments on: The WordPress template hierarchy explained https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/ All the Word that's fit to Press Wed, 04 Nov 2015 12:59:00 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Marco Floriano https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-23073 Wed, 04 Nov 2015 12:59:00 +0000 https://torquemag.io/?p=73367#comment-23073 In reply to Mark Simchock.

It´s probably a good idea if you are a software engineer or a system designer. If you know your way through MVC, it’s perfect. But many theme developers are not backend coders, they are frontend designers in first place. The WordPress templates is a pre-configured way to put your frontend code to work fast and easy.

]]>
By: Marco Floriano https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-23072 Wed, 04 Nov 2015 12:48:00 +0000 https://torquemag.io/?p=73367#comment-23072 Nice post, difficult concepts for beginners in wordpress theme development really well explained. Thanks!

]]>
By: Mark Simchock https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-19769 Tue, 30 Dec 2014 14:08:00 +0000 https://torquemag.io/?p=73367#comment-19769 In reply to Nick.

p.s. It’s generally the same idea but instead of defaulting control to WP, this approach put the control / responsibility in your hands – across any / all vues / partials you define in your theme.

]]>
By: Mark Simchock https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-19768 Tue, 30 Dec 2014 13:53:00 +0000 https://torquemag.io/?p=73367#comment-19768 In reply to Nick.

I was hoping you would ask 😉

Here ya go. Already done.

https://github.com/wpezboilerstrap

Note: The Uno example does have all the usually “root” templates (e.g., page, single, etc) but the fact is, they’re not necessary. I left them in so people wouldn’t immediately get “lost.” In time I’ll do another demo without them. In any case, what you get is full control of any partial (view) as based on any business rules you can define and code. Not that you can’t do that now, but this architecture is more structured, logical and conducive to “the right content at the right time.”

Suggestion: Start with the Getting Started (though it probably needs to be updated, sorry). That’s at least an overview on how the old WP approach has been ditched for something more MVC-esque.

Note: While we all love MVC I did try to keep it close-ish to how WP operates – a hybrid if you will. That is, if anyone is going to scorn me / the approach for not being “pure MVC (or some of its gazillion variants) then please save your breathe. The intention is not to abandon WP for MVC but us help WP think in ways that make more sense in a modern dev world.

Finally, I would also describe the approach as somewhat experimental. I mean, it does work. Not a problem. It’s just that some of the finer points are still being worked out as various real world (read: non demo) issues come up.

Enjoy! Let me know what you think.

]]>
By: Nick https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-19766 Tue, 30 Dec 2014 09:08:00 +0000 https://torquemag.io/?p=73367#comment-19766 In reply to Mark Simchock.

Hey Mark, interesting thought. Maybe you could give it a whirl and tell us how it went?
Cheers, Nick

]]>
By: Mark Simchock https://torquemag.io/2014/12/wordpress-template-hierarchy-explained/#comment-19765 Mon, 29 Dec 2014 19:16:00 +0000 https://torquemag.io/?p=73367#comment-19765 I don’t want to get too off topic but it would be interesting to see an article / discussion where most / all WP templates were abandoned for simply the index.php. And then from there route / define template parts based on the request. It easy enough to use the template hierarchy, but then end up with what feels like quite a bit of duplicate code, redundant “views”, etc.

I realize that’s not how WP thinks, but maybe it should? 😉

]]>