Main Stylesheet (style.css) | WordPress Theme Developer Handbook

  1. Create a new folder in the wp-content/themes directory with your theme’s name.
  2. Inside this folder, create a new file named style.css.
  3. Open the style.css file in a text editor.
  4. Add the following code to the top of the file to define the theme’s information:
vbnet
/*
Theme Name: My Theme
Theme URI: http://example.com/my-theme
Description: This is a description of my theme.
Author: My Name
Author URI: http://example.com
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: responsive-layout, custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/
  1. Replace the Theme Name, Theme URI, Description, Author, Author URI, and Version fields with your own information.
  2. Optionally, you can add additional tags to describe your theme’s features.
  3. Below the theme information, you can begin adding your CSS styles.
css

body {
background-color: #fff;
color: #333;
font-family: Arial, sans-serif;
}h1 {
font-size: 2em;
}
a {
color: #06c;
text-decoration: none;
}

  1. Save the style.css file and upload the entire theme folder to the wp-content/themes directory in your WordPress installation.
  2. Activate the theme in the Appearance section of the WordPress dashboard to see your styles in action.

That’s it! You’ve now created a style.css file for your WordPress theme. Remember to use proper CSS syntax and best practices when adding your styles to ensure your theme looks great and functions properly.