Packaging the Theme
Prepare your theme for distribution — code review, zip packaging, and WordPress.org submission guidelines.
Packaging the Theme
Your custom WordPress theme is complete! Now let's package it properly for distribution, sharing, or submission to the WordPress theme directory.
Final Theme File Structure
developer-coffee/
├── style.css ← Theme metadata + all CSS
├── index.php ← Main fallback template
├── functions.php ← Theme setup, menus, scripts, widgets
├── header.php ← Site header
├── footer.php ← Site footer
├── sidebar.php ← Widget area
├── front-page.php ← Homepage template
├── page.php ← Static page template
├── single.php ← Single blog post template
├── archive.php ← Category/tag/author archives
├── search.php ← Search results page
├── 404.php ← Page not found
├── screenshot.png ← Theme preview (1200×900)
├── img/
│ ├── logo.png
│ ├── hero.jpg
│ └── ...
├── js/
│ └── script.js
└── css/
└── extra.css (if any)
Pre-Packaging Checklist
| Check | What to Verify |
|---|---|
✅ style.css header | Theme name, author, version, description are all filled in |
✅ screenshot.png | Exists at 1200×900, looks professional |
✅ wp_head() | Present in header.php inside <head> |
✅ wp_footer() | Present in footer.php before </body> |
✅ body_class() | Present on the <body> tag |
✅ wp_enqueue_*() | All CSS/JS properly enqueued in functions.php |
| ✅ Escaping | User input escaped with esc_html(), esc_attr(), esc_url() |
| ✅ Translation-ready | Strings wrapped in __() or _e() |
| ✅ No errors | Enable WP_DEBUG in wp-config.php — fix any warnings |
Enabling Debug Mode
In wp-config.php, set:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);
Fix any errors or warnings that appear.
Creating the ZIP File
- Navigate to the
themes/folder - Right-click your theme folder (
developer-coffee) - Select "Send to → Compressed (zipped) folder"
- You'll get
developer-coffee.zip
Installing from a ZIP
To install on another WordPress site:
- Go to Appearance → Themes → Add New → Upload Theme
- Choose your
developer-coffee.zip - Click Install Now → Activate
WordPress.org Submission Requirements
If you want to submit to the official WordPress theme directory:
- Must be GPL licensed (including images and CSS)
- No obfuscated code
- Must use WordPress recommended functions (no hardcoded scripts)
- Must pass the Theme Check plugin tests
- Must be accessible — proper heading hierarchy, keyboard navigation
- Must include a readme.txt file
Using the Theme Check Plugin
- Install the "Theme Check" plugin from the dashboard
- Go to Appearance → Theme Check
- Select your theme and run the check
- Fix any REQUIRED items (warnings are optional but recommended)
Key Takeaways
- Verify all required WordPress hooks and functions before packaging
- Enable
WP_DEBUGto catch any PHP errors or warnings - Package as a ZIP file for easy distribution
- Use the Theme Check plugin for quality assurance
- Follow WordPress.org guidelines if submitting to the theme directory