In addition to CSS style information for your theme, style.css provides mandatory details about the Theme.
- The PHP template files which control the way the site pages generate the information from your WordPress database to be displayed on the site.
- The optional functions file (functions.php) as part of the WordPress Theme files.
and, the one this post is about
- The stylesheet called style.css, which controls the presentation (visual design and layout) of the website pages and more …
Why styles.css is an important file in your theme?
Styles.css is a mandatory component because in addition to CSS style information, it tells WordPress important details like the theme name, the theme author, the theme description and the chosen license.
These details are added in the form of comments in the header of the file.
The comment header lines are required for WordPress to be able to identify the Theme and display it in the Administration Panel under Design > Themes.
How to deal with styles.css with Pinegrow?
When your export a WordPress theme with Pinegrow a default header is added to the styles.css file. (see the example below)
/* Theme Name: PGWP Landy Theme URI: http://wordpress.org/themes/ Author: Your name Author URI: http://pinegrow.com/ Description: This theme was created with Pinegrow Web Editor. Version: 1.0 */
Depending on your goal (commercial distribution, personal use …) it can be a good idea to enter your own data in that section.
Be aware that no two themes are allowed to have the same details listed in their comment headers, as this can lead to problems in the theme selection dialog and also, if you make your own theme by copying an existing one, make sure you change this information first.
The recommended workflow is the following:
- If you have style.css present in the root level of your source theme folder, export the theme. Pinegrow will add headers to the exported style.css only.
- Copy paste these headers back to style.css in source folder and make any further changes to header there (with Page -> Edit code or external code editor)
The file will be then copied to theme folder during the export.
Note: It is also fine if you don’t have style.css in the source folder but only in theme folder (the default one generated by Pinegrow WP). You can edit the header there.
IMPORTANT: What is definitely not recommended is having style.css without headers in source folder and editing style.css headers in theme folder. This behaviour can only leads to conflicts.
Here is a sample of what you could add:
/* Theme Name: The name of your theme Theme URI: A link to a page specifically related to the Theme Author: The Name of the Author Author URI: A link to an author's personal web site or project/development website. Description: A description of the theme. Version: The version number of the theme. License: The type of license chosen for the theme. License URI: A link to the license description. Tags: A list of tags, separated by commas. A full list of recommended tags can be found by selecting "Feature Filter" in the Themes Directory. Text Domain: Enter the same value you have for the Theme slug in Pinegrow. */
Last updated on December 1, 2015 at 1:28 pm