Episode 12 of 32
Installing a Blank Theme
Create the minimum files needed for a WordPress theme — style.css and index.php — and activate it.
Installing a Blank Theme
Now it's time to start building our WordPress theme! We'll create the minimum files WordPress needs to recognize a valid theme, then activate it.
Minimum Theme Requirements
A WordPress theme needs only two files to be valid:
style.css— with a special comment header (theme metadata)index.php— the main template file
Step 1: Create the Theme Folder
Navigate to your WordPress themes directory:
C:\wamp64\www\developer-coffee\wp-content\themes\
Create a new folder called developer-coffee:
C:\wamp64\www\developer-coffee\wp-content\themes\developer-coffee\
Step 2: Create style.css
Create style.css inside your theme folder with this comment header:
/*
Theme Name: Developer Coffee
Theme URI: http://developer-coffee.com
Author: Your Name
Author URI: http://yourwebsite.com
Description: A custom theme built from a PSD design —
a developer blog with coffee-themed styling.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: developer-coffee
*/
This comment block is required — WordPress reads it to identify the theme in the admin panel.
Theme Header Fields Explained
| Field | Required? | Purpose |
|---|---|---|
Theme Name | ✅ Yes | The name shown in Appearance → Themes |
Description | Recommended | Shown in the theme details modal |
Version | Recommended | Theme version number |
Author | Recommended | Theme developer name |
Text Domain | Recommended | Used for translation/internationalization |
Step 3: Create index.php
Create a minimal index.php:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php bloginfo('name'); ?></title>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<h1>Developer Coffee Theme</h1>
<p>Theme is active! We'll build this out in the coming episodes.</p>
<?php wp_footer(); ?>
</body>
</html>
Important WordPress Functions Used
| Function | What It Does |
|---|---|
language_attributes() | Outputs lang="en-US" attribute |
bloginfo('charset') | Outputs the site's character set (UTF-8) |
bloginfo('name') | Outputs the site title |
wp_head() | Required — lets WordPress and plugins add to <head> |
body_class() | Adds dynamic CSS classes to <body> |
wp_footer() | Required — lets WordPress and plugins add scripts before </body> |
Step 4: Activate the Theme
- Go to the WordPress admin: Appearance → Themes
- You should see "Developer Coffee" listed
- Hover over it and click "Activate"
- Visit the site — you'll see the basic message from
index.php
Your Theme Folder Structure (So Far)
developer-coffee/
├── style.css ← Theme metadata + CSS styles
└── index.php ← Main template file
Key Takeaways
- A WordPress theme needs minimum two files:
style.cssandindex.php - The comment header in
style.cssis how WordPress identifies the theme - Always include
wp_head()andwp_footer()— they're required hooks body_class()adds useful CSS classes for targeting specific pages- Activate your theme from Appearance → Themes in the admin