Creating your own WordPress Theme: Style.css

Serie WordPress Theme development

We are on the next step. Now you already know what is a WordPress Theme and what files you should take into account. If we take a theme similar to the look you want it will be easier and faster work but let’s effort us and create a Theme from scratch.

Chapter 1. What is a WordPress Theme?
Chapter 2. Creating your own WordPress Theme: Style.css
Chapter 3. The Content: index.php
Chapter 4. The header, the footer and the sidebar

Chapter 2. Creating your own WordPress Theme: Style.css

The style.css is required for your theme to be a theme, without this file it can’t work. Indeed, a theme just needs the files style.css and index.php to work. Getting back to the Template Hierarchy you could see how WordPress Substitutes missing templates when your theme doesn’t have them.

The style file should start with some information about the theme and how to use it in the Themes Control Panel.


/*
Theme Name: Twenty Seventeen
Theme URI: https://wordpress.org/themes/twentyseventeen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
Version: 1.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentyseventeen
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

Make sure that your theme name is unique to your installation.

Now, you should determine the layout and appearance of your web site. There are plenty of templates that provides several layouts for web sites arrangements or you could build your own structure from scratch.

Do you want to carry on with Chapter 3 The Content: index.php?