Thord Daniel Hedengren - Smashing WordPress_ Beyond the Blog-Wiley (2014)

(avery) #1

170 PART II • Designing and Developing WordPress Themes


THEMES VERSUS PLUGINS


The themes are not only the look and feel of a site these days, but they are also simple plugins.
You use themes to get everything to be displayed where you want it and to break the normal
flow of posts provided by the loop. You can achieve a lot using the template and conditional
tags; and by adding extra functionality in functions.php, by using action hooks, and by being
crafty overall, you can build just about anything.

As I’ve hinted at in this chapter, cramming functions.php full isn’t always such a great idea. A
lot of things you do in that file can just as well be done by a plugin, and although that is
unnecessary or even redundant at times, sometimes it truly is the best decision. After all, the
whole idea with various skinning concepts in publishing systems is to separate as much
design from the code as possible. When it comes to WordPress themes, this means that you’ll
have to break that rule a bit if you want to do crafty things.

A lot can be handled by plugins rather than code in the themes, which fits better with the
whole dividing design and code concept. You’ll learn a lot more about plugins in the next
couple chapters.
Free download pdf