0
0
Wordpressframework~20 mins

Style.css and theme metadata in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Style.css Metadata Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the Style.css file in a WordPress theme?

In WordPress themes, the style.css file contains important information. What is its main purpose?

AIt stores the images and media files used by the theme.
BIt contains the PHP code that runs the theme's backend logic.
CIt holds the theme's CSS styles and metadata like theme name and author.
DIt manages the database connections for the theme.
Attempts:
2 left
💡 Hint

Think about what controls the look and basic info of a theme.

📝 Syntax
intermediate
2:00remaining
Identify the correct theme metadata header in style.css

Which of the following style.css headers correctly defines the theme name and author?

A
// Theme Name: My Cool Theme
// Author: Jane Doe
B
/*
Theme Name: My Cool Theme
Author: Jane Doe
*/
C
<!-- Theme Name: My Cool Theme
Author: Jane Doe -->
D
# Theme Name: My Cool Theme
# Author: Jane Doe
Attempts:
2 left
💡 Hint

WordPress expects the metadata in a CSS comment block.

component_behavior
advanced
2:00remaining
What happens if the theme metadata is missing in style.css?

If a WordPress theme's style.css file lacks the required metadata header, what will WordPress do when you try to activate the theme?

AWordPress will delete the theme files automatically.
BWordPress will activate the theme but show a warning message.
CWordPress will activate the theme normally without any issues.
DWordPress will not list the theme in the Appearance > Themes page.
Attempts:
2 left
💡 Hint

Think about how WordPress recognizes themes.

🔧 Debug
advanced
2:00remaining
Why does this style.css metadata cause the theme to be unrecognized?

Look at this style.css header snippet:

/*
Theme-Name: Awesome Theme
Author: John Smith
*/

Why does WordPress fail to recognize this theme?

ABecause the metadata key <code>Theme-Name</code> is incorrect; it should be <code>Theme Name</code> without a dash.
BBecause the file is named style.css instead of theme.css.
CBecause the comment block is not closed properly.
DBecause the author name is missing an email address.
Attempts:
2 left
💡 Hint

Check the exact spelling of metadata keys.

state_output
expert
3:00remaining
What is the output of this style.css metadata block in WordPress theme info?

Given this style.css metadata block:

/*
Theme Name: Simple Theme
Theme URI: https://example.com/simple-theme
Author: Alice
Author URI: https://example.com
Description: A simple WordPress theme.
Version: 1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: simple-theme
Tags: light, two-columns, responsive-layout
*/

Which of the following is true about how WordPress displays this theme in the dashboard?

AThe theme will show the name 'Simple Theme', author 'Alice', version '1.0', and tags including 'responsive-layout'.
BThe theme will show the author 'Alice' but no theme name or description.
CThe theme will show the name 'Simple Theme' but no author or version info.
DThe theme will not appear because the metadata is too long.
Attempts:
2 left
💡 Hint

WordPress uses all standard metadata keys to display theme info.