An overview of how we build custom, bespoke WordPress themes - from techniques to file structures and automation - this is an insight into how we develop (profitable!) bespoke custom WordPress themes.
WordCamp Bristol 2019 - WordPress custom theme building
1. Jonny Allbut / Head of Digital
Custom theme building
structures & techniques
to save your sanity!
2. Handover and assets
• Work with your creative - you’re a team!
• Establish scope of front-end early
• Keep on-board as project evolves
• Don’t start coding until creative all signed off
• Colour palettes & image/vector assets
• Image sizes
@wearewider
wider.co.uk
4. How we build sites
• Theme framework (parent theme) with child theme
• Supporting bespoke plugins
• EXTREMELY limited 3rd party plugins
• Carefully selected applicable third-party JS
• Our own front-end JS UI library
• Our own ‘theme toolbox’ plugin:
• Navigation
• Content output and formatting
• Taxonomy
• Navigation/menus
@wearewider
wider.co.uk
5. Initialising the project
• Alfred for automation
• Checklist built into starter stack
• Text strings to replace
• Initial graphics to generate
• Notes on initial setup
• Pitfalls and other tasks not to forget
• Go-live checklist
@wearewider
wider.co.uk
15. Outputting content
• Build output at top of file, keep output section clean
• Consider building an output array
• Escape EVERYTHING… never trust any user content!
• Escape output at latest point possible
• Use built-in output functions like:
• esc_html()
• esc_attr()
• Remember _e variants too - esc_html_e()
@wearewider
wider.co.uk
17. Avoiding pitfalls
• Don’t repeat yourself (DRY)
• Don’t over-engineer
• Don’t re-invent the wheel, does WordPress do it already?
• Have a great debug function - see wfx_debug()
• Don’t be scared of space - write legible code!
• Refactor as you go, or mark as todo task
• Test early, test often
• Be conscious of optimisation, but leave mostly until end
• Have 2 or more monitors… have a ‘crap’ colour setting!
@wearewider
wider.co.uk
18. Our Tools of the trade
• Development
• MampPro for local server
• Espresso for editing CSS
• Nucleo for icon font generation
(Fontello wasn’t bad either!)
• Sublime/Atom for coding
• Sequel Pro for MySQL databases
• Supporting
• Alfred for automation
• Tower for Version control/GIT
• DeployHQ for auto-deployment to
dev and live servers
• Testing
• Browser Stack for testing
different browsers
• WAVE and Siteimprove for
accessibility checks
• Web Developer for various tasks
(validation/colour checks/turning
off JS/CSS etc)
• Optimisation
• Codekit for minification/checking
• ImageOptim for image compression
@wearewider
wider.co.uk