Stumbled across this just now: the official WordPress guidelines for separating style from functionality. What WordPress functionality may be incorporated into a theme, and which functions should be left to the plugin developers?
The line is tighter than you might think. And it turns out, it is a line I have crossed.
The guidelines state in part (slightly edited for readability):
Themes must not incorporate SEO options, content sharing buttons/links, custom post-content shortcodes, or Custom Post Types; or Removing or modifying non-presentational core hooks.
Yowser! I think I’ve used every one of those functions in theme projects. In fact, my Widgeon Starting Point incorporates a breadcrumb plugin as an included file. I think that pretty clearly falls outside the bounds of this guideline criteria.
How did this WordPress functionality get in my theme?
It all started when I began buying professional themes on ThemeForest. I liked them because they were more flashy than the free themes from WordPress. I found that for less than a hundred bucks, I could set up a professional-looking website quickly. It was great, but it taught me bad habits.
Pro themes break the rules
Professional themes are not required to follow the WordPress theme development guidelines. Only the free themes distributed on wordpress.org are ever vetted by a committee. And I knew this. But it didn’t stop me from imitating the pro theme authors when it came time to create my own themes. Because I had been using these themes, I had come to expect this functionality from a WordPress theme. So I began to load up my themes with breadcrumbs, and security features, and social media buttons, and custom shortcodes, and custom post types, just like the professional theme developers.
I think it’s worth noting that in their enthusiasm for incorporating functionality, many WordPress developers have committed serious errors. Most notably, I once bought a theme that used the Tim Thumb script as an included file. I deleted it, of course; but this illustrates the point that just because a theme is professionally designed and marketed, does not mean it is flawlessly coded.
I smell an update
Well, now that I know, I’ll be able to do something about it.
First up, I’ll release a slimmed-down version of the Widgeon Starting Point, excluding most of the above. Will I exclude it all? Maybe not. The purpose of the starting point is to form the basis of client projects; and clients expect functionality. And even though nobody likes to admit it, there are limitations to the wisdom of even the open source community. Some plugins are very bloated, or reduce website performance, or introduce security vulnerabilities of their own.
As long as I’m not distributing my theme through the WordPress repository, I may go ahead and continue to gently break some of the rules. Sometimes, it’s the easiest way to integrate WordPress functionality into a website design project.