← Back to all tutorials

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

CheckWhat to Verify
style.css headerTheme name, author, version, description are all filled in
screenshot.pngExists 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
✅ EscapingUser input escaped with esc_html(), esc_attr(), esc_url()
✅ Translation-readyStrings wrapped in __() or _e()
✅ No errorsEnable 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

  1. Navigate to the themes/ folder
  2. Right-click your theme folder (developer-coffee)
  3. Select "Send to → Compressed (zipped) folder"
  4. You'll get developer-coffee.zip

Installing from a ZIP

To install on another WordPress site:

  1. Go to Appearance → Themes → Add New → Upload Theme
  2. Choose your developer-coffee.zip
  3. 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

  1. Install the "Theme Check" plugin from the dashboard
  2. Go to Appearance → Theme Check
  3. Select your theme and run the check
  4. Fix any REQUIRED items (warnings are optional but recommended)

Key Takeaways

  • Verify all required WordPress hooks and functions before packaging
  • Enable WP_DEBUG to 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