Working on a post to help folks get started in WordPress development. If you’re experienced, what are your pain points with newbie devs?
— Cliff Seal (@cliffseal) December 26, 2013
As I was writing “Get Started in Professional WordPress Design & Development”, I asked some folks on Twitter what their pain points were with new WordPress developers. I was immediately convinced that this needed its own post, focused on folks who are beginning to create themes and plugins.
Sure, there are plenty of folks who will simply tell you to “just dive in”: read blogs, get involved in the community, go to meetups and WordCamps. All that’s very sound advice, but how do you just get started better? How do you prioritize all the things there are to learn? I was literally just speaking with a friend who wants to get going with WordPress development, but with so much to take in, where do you begin?
Child Theming and Plugin Building
Before you touch a line of code in a WordPress environment, you must know when and how to create child themes and plugins. If you want to get better at this, swear off ever editing code in an existing, non-child theme—no matter how small the tweak is (unless you built the theme from scratch).
Although there’s some room for debate, you ought to create a child theme when you want to tweak something that’s already in the existing parent theme or you want to add something that won’t be missed if the themes change, like web fonts. If you’re using a Genesis child theme, you’ll need to get acquainted with hooks.
Then, learn how to put all functionality that doesn’t deal with design in a plugin. Use powerful, premium plugins when the serve you, and familiarize yourself with whatever hooks and functions they might offer. If you need a totally new function, write it! Use Tom’s boilerplate if you’d like.
Bonus: if you like an existing open source plugin, but need to make changes to the code, use Git to create a feature branch from that plugin. That way, you can always merge any updates the original plugin author might push without losing your changes.
Understanding Core WordPress Ideas
If you can’t write a WordPress loop from scratch and understand everything that’s happening in it, you’re flying blind. Read the Codex or some other article and get intimately familiar. Understand the difference between
new WP_Query(). You can’t grow in WordPress development without truly understanding key concepts within it. I’m not saying you have to know everything—we all discover surprises all the time—but it ought to be the exception instead of the rule.
Each time you attempt something new, or run into a roadblock in what you’re trying to accomplish, go find the documentation in the Codex.
Using Native WordPress Functions and API’s
@cliffseal My experience has been that they are mostly unfamiliar with WordPress functions, if they know PHP.
— Micah Wood (@wpscholar) December 26, 2013
In that Codex documentation, you’ll discover the magic of WordPress API’s and functions. As Tom McFarlin says to aspiring WordPress developers:
Ultimately, [knowing WordPress API’s] means that whenever you’re faced with a problem and you’re not exactly sure how to solve it, you know what facilities are available to solve it. From that point, it’s a matter of looking up the documentation or implementing your own solution by following core features (and the coding standards!).
When you hear the sound of a head hitting a desk, there’s a 79% chance it’s a WordPress developer discovering that there was an API there all along for the custom code they’ve been churning out. From theme customization to caching to HTTP calls to rewrites, it’s all there. One of the biggest perks is that you get to worry far less about server environments and PHP deprecation. The other big perk is that it takes a stupidly small amount of code to make otherwise complex things happen.
@cliffseal using wp functions. Stopped counting the number of times I have seen an html based navigation. Same goes for enquing scripts.
— Michael (@schurpf) December 26, 2013
Further, you’ve got to look for native WordPress functions to accomplish your goal. Check the codex three individual times if you’re about to write a SQL query, because it’s almost certainly not necessary and far less efficient. And, as Michael mentioned in his tweet here, failure to use WordPress functions for things like enqueuing scripts or adding a navigational menu compromises the quality of your code and fails to use logic built into the codebase. Plus, the menu is a good example of a place where you’re forcing a client to edit code to make changes that should be doable from within a UI.
Finding WordPress Tools
— Alan Crissey (@alancrissey) December 26, 2013
Let’s all agree that being a part of a community is good for everyone that invests in it. We get that, and I’m not downplaying it. But, as a developer, one of the biggest benefits is access to news about WordPress tools. As you follow developers on Twitter, read their blogs, and star their repos on GitHub, you’ll be in-the-know when new things are released. This community is incredibly generous, thanks in no small part to a very open-source mentality. Most of the most important tools I use in development are absolutely free, making the ones I do need to pay for a no-brainer.
There’s really no substitute for this sort of involvement. Robert’s got a good list of people to follow, and those connections should lead you to others.
Once you’ve got a good foundation, the rest is time and learning. Write tons of code. Ask for help. Release a theme. Submit a plugin. Go to WordCamps. Go to meetups. Get a WordPress mentor. Get involved with core.
Last year, I wrote about how I stepped up my involvement in 2012.
One last thing: need help? Leave something in the comments, or contact me. I’ll do what I can to help, or lean a little bit on that community of developers I mentioned, so that we can help you grow. We’re in this together.