0
0
Wordpressframework~5 mins

Style.css and theme metadata in Wordpress - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AAuthor
BTheme Name
CVersion
DDescription
Where must the theme metadata be placed inside style.css?
AInside a CSS comment block at the top
BInside a JavaScript block
CAt the bottom of the file outside comments
DInside HTML tags
What happens if you add CSS rules below the metadata in style.css?
AThey overwrite the metadata
BThey are ignored by WordPress
CThey cause an error
DThey style the theme's front-end pages
Which of these is NOT a common metadata field in style.css?
ATheme URI
BAuthor URI
CDatabase Name
DLicense
Why is the style.css file important besides holding CSS styles?
AIt contains theme metadata WordPress uses to identify the theme
BIt stores the theme's PHP code
CIt holds the WordPress database credentials
DIt manages WordPress plugins
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.