Be responsible with your code
- get organized
- version it
- if possible, work locally
I know you can “just go in and change that one line”. What happens when that one change mushrooms into a rabbit hole?
Slow is safe, safe is fast.
Compartmentalize your code
Try not to repeat yourself – if you wind up writing the same code twice, you could probably rewrite it to account forbeing used more than once.
Learn by doing
If it’s been in WordPress since 3.0, learn how to do it without a plugin.
Organize your stylesheet
Think of your theme in a mobile-first mindset.
When you write your CSS, avoid mixing widths and other positioning CSS with typography, backgrounds, and colors. Move all the positioning & dimensional styles into media breakpoints to avoid repeating styles.
Don’t hard-link scripts, css, or URLs
Use the various “url” functions for src or href attributes in your templates: home_url(), get_template_directory_uri(), etc. Try to avoid writing out things like
href="/my-page" because your site may get moved to a subdirectory and that relative path will break. Use something like
a href="<?php echo home_url(); ?>/my-page"
Versioning ( git ):
Learn the basics of the command line:
In actual day-to-day use of Git , SVN, etc, there’s nothing wrong with a GUI tool
- Save yourself time.
- Avoid relying on crappy network connections.