Recall & Review
beginner
What is the purpose of the
style.css file in a WordPress theme?The
style.css file holds the main CSS styles for the theme and contains the theme metadata in a comment block at the top. This metadata tells WordPress about the theme's name, author, version, and more.Click to reveal answer
beginner
Which metadata fields are required in the
style.css header for WordPress to recognize a theme?The required field is Theme Name. Other common fields include Theme URI, Author, Author URI, Description, Version, and License.
Click to reveal answer
beginner
Show an example of a minimal
style.css header with theme metadata./*
Theme Name: Simple Theme
Author: Jane Doe
Version: 1.0
Description: A clean and simple WordPress theme.
*/
Click to reveal answer
intermediate
Why must the theme metadata be inside a CSS comment block in
style.css?Because WordPress reads the metadata from the comment block at the top of
style.css without affecting the CSS styles. This keeps metadata separate from actual CSS rules.Click to reveal answer
beginner
Can you include custom CSS styles below the theme metadata in
style.css? What happens?Yes, you can add CSS rules below the metadata comment block. WordPress loads these styles to style the theme's front-end pages.
Click to reveal answer
What is the minimum required metadata field in
style.css for WordPress to detect a theme?✗ Incorrect
WordPress requires at least the 'Theme Name' field in the style.css header comment to recognize the theme.
Where must the theme metadata be placed inside
style.css?✗ Incorrect
Theme metadata must be inside a CSS comment block at the very top of style.css for WordPress to read it.
What happens if you add CSS rules below the metadata in
style.css?✗ Incorrect
CSS rules below the metadata are loaded by WordPress and style the theme's pages.
Which of these is NOT a common metadata field in
style.css?✗ Incorrect
'Database Name' is not a metadata field in style.css; the others are common fields.
Why is the
style.css file important besides holding CSS styles?✗ Incorrect
Besides CSS, style.css holds the theme metadata that WordPress reads to identify and display the theme.
Explain the role of the
style.css file in a WordPress theme and describe what theme metadata it contains.Think about how WordPress knows your theme's name and who made it.
You got /4 concepts.
Describe how to properly format the theme metadata in
style.css and why it must be inside a comment block.Remember CSS comments start with /* and end with */.
You got /4 concepts.