0
0
Wordpressframework~20 mins

CMS architecture overview in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
CMS Architecture Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the role of the WordPress Loop in CMS architecture?
In WordPress CMS architecture, what does the Loop primarily do?
AIt handles database backups and restores automatically.
BIt manages user authentication and permissions for the admin panel.
CIt processes and displays each post or page content dynamically based on the query.
DIt controls the loading of CSS and JavaScript files on the front end.
Attempts:
2 left
💡 Hint
Think about how WordPress shows posts on a blog page.
component_behavior
intermediate
2: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?
AIt manages the caching of static assets like images and stylesheets.
BIt allows developers to add or modify features without changing core WordPress files.
CIt replaces the WordPress theme system with custom templates.
DIt directly modifies the WordPress database schema for custom tables.
Attempts:
2 left
💡 Hint
Think about how plugins extend WordPress safely.
📝 Syntax
advanced
2:00remaining
What error does this WordPress PHP snippet cause?
Consider this PHP code snippet in a WordPress theme file:
<?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; ?>
AFatal error: Call to undefined function have_posts() if WordPress environment is not loaded.
BNo error; it outputs the titles of posts correctly.
CParse error due to missing semicolon after the_post() call.
DWarning: the_title() function requires a parameter but none given.
Attempts:
2 left
💡 Hint
Think about what happens if this code runs outside WordPress context.
state_output
advanced
2:00remaining
What is the output of this WordPress shortcode function?
Given this shortcode function in WordPress:
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');
AHello, Anna!
BHello, Guest!
C[greet name="Anna"]
DError: Undefined index 'name'
Attempts:
2 left
💡 Hint
Look at how the function uses the 'name' attribute with a default.
🔧 Debug
expert
2:00remaining
Why does this WordPress theme not load custom CSS?
A developer added this code to functions.php to load a custom CSS file:
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');
AThe add_action hook 'wp_enqueue_scripts' is misspelled and never runs.
BThe function name load_custom_styles conflicts with a core WordPress function.
Cwp_enqueue_style must be called inside the header.php file, not functions.php.
DThe CSS file path is incorrect or the file does not exist at /css/custom.css.
Attempts:
2 left
💡 Hint
Check if the CSS file is actually present where the code expects it.