If you’ve just started theme writing for a WordPress website, you probably know all about WP’s own theme guide that can be found at https://make.wordpress.org/themes/handbook/review/required/. If you haven’t already read this, go and do so now!
Theme Guide in a Nutshell
- If they are available, use WP features and functionality before anything else.
- Never use options frameworks
- Do not use external APIs, such as Jetpack and Gravatar
- If you are working with a WordPress.com them, you ned to use the latest WP features
- If code won’t run on WP.com, don’t use it.
- When modifying the output of template tags, use filters
- Do not directly access PHP super globals with your themes
- Zero output buffering
- Do not use custom fields
- Do not use post meta boxes
- Do not remove Core hooks
- Because variable names and protect function conflicts in global name space, you should make sure to use theme slug prefixes
- When developing a theme, always use the HTML5 doctype
- Your WordPress starter theme HAS to be responsive
- It also has to be retina-ready
- Never use ! except as a last resort
- Code and scripts don’t work for support lower than IE9
Core Functionality and Features
- Your code and widgets should not be a duplicate of any WordPress.com functionality
- Your themes should support widgets
- All themes need at least 1 custom menu
- Provide context when necessary
- Never use common anti-patterns
- Employ a right-to-left style for your themes
- Make that translators are able to deactivate web fonts that are untranslatable in their language
Options and Settings
- Theme options should be implemented via the Customiser only
- Collate your theme options in one section and name it “Theme Options”
- Users should NOT be able to add their own scripts and styles
- Your themes have to support Jetpack Infinite Scroll
Stylesheets and Scripts
- HTML must not be hooked into wp_head
- Do not minificate
- Your primary CSS has to be in style.css.
- All theme tags in style.css are lower case. No spaces
- There is a temple hierarchy that must be respected when theme writing
- During your theme development use full loops at all times. Your templates will not function without them
- All widget titles should contain the prefix Widget Title
- Hardcoded widgets are not to be used in widget areas
- If you’ve got a visible link to a feed, make sure it doesn’t appear in the theme
Thank you for reading our theme guide.
Contact us if you need help with theme writing!