Challenge - 5 Problems
CMS Architecture Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What is the role of the WordPress Loop in CMS architecture?
In WordPress CMS architecture, what does the Loop primarily do?
Attempts:
2 left
💡 Hint
Think about how WordPress shows posts on a blog page.
✗ Incorrect
The Loop is the core mechanism that WordPress uses to fetch and display posts or pages dynamically according to the current query.
❓ component_behavior
intermediate2:00remaining
How does the WordPress Plugin API affect CMS architecture?
Which behavior best describes the role of the WordPress Plugin API in the CMS architecture?
Attempts:
2 left
💡 Hint
Think about how plugins extend WordPress safely.
✗ Incorrect
The Plugin API provides hooks and filters that let developers extend or change WordPress behavior without altering core code, preserving upgradability.
📝 Syntax
advanced2:00remaining
What error does this WordPress PHP snippet cause?
Consider this PHP code snippet in a WordPress theme file:
What error will this code produce when run?
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; endif; ?>
What error will this code produce when run?
Wordpress
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; endif; ?>
Attempts:
2 left
💡 Hint
Think about what happens if this code runs outside WordPress context.
✗ Incorrect
The functions have_posts() and the_post() are defined by WordPress core. If the environment is not loaded, calling them causes a fatal error.
❓ state_output
advanced2:00remaining
What is the output of this WordPress shortcode function?
Given this shortcode function in WordPress:
What will be the output of the shortcode [greet name="Anna"] in a post?
function greet_shortcode($atts) {
$name = $atts['name'] ?? 'Guest';
return "Hello, $name!";
}
add_shortcode('greet', 'greet_shortcode');What will be the output of the shortcode [greet name="Anna"] in a post?
Wordpress
function greet_shortcode($atts) {
$name = $atts['name'] ?? 'Guest';
return "Hello, $name!";
}
add_shortcode('greet', 'greet_shortcode');Attempts:
2 left
💡 Hint
Look at how the function uses the 'name' attribute with a default.
✗ Incorrect
The shortcode function checks if 'name' is set in attributes; if yes, it uses it. So it outputs 'Hello, Anna!'.
🔧 Debug
expert2:00remaining
Why does this WordPress theme not load custom CSS?
A developer added this code to functions.php to load a custom CSS file:
But the CSS does not appear on the site. What is the most likely cause?
function load_custom_styles() {
wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom.css');
}
add_action('wp_enqueue_scripts', 'load_custom_styles');But the CSS does not appear on the site. What is the most likely cause?
Wordpress
function load_custom_styles() {
wp_enqueue_style('custom-style', get_template_directory_uri() . '/css/custom.css');
}
add_action('wp_enqueue_scripts', 'load_custom_styles');Attempts:
2 left
💡 Hint
Check if the CSS file is actually present where the code expects it.
✗ Incorrect
If the CSS file path is wrong or the file is missing, WordPress enqueues a non-existent file, so styles don't load.