Challenge - 5 Problems
WordPress Custom Theme Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
π§ Conceptual
intermediate1:30remaining
Why do custom WordPress themes provide full control over site design?
Which of the following best explains why custom themes give developers full control over a WordPress site's design and functionality?
Attempts:
2 left
π‘ Hint
Think about what building a theme from scratch allows you to do compared to using pre-made themes.
β Incorrect
Custom themes are created by developers to control every detail of the siteβs look and features. This means no limits from pre-built templates or plugins.
β component_behavior
intermediate1:30remaining
What happens when you modify a custom theme's template file?
If you edit a template file in a custom WordPress theme, what is the expected effect on the website?
Attempts:
2 left
π‘ Hint
Think about how WordPress uses theme template files to build pages.
β Incorrect
Template files in custom themes control how pages look. Editing them changes the site immediately when refreshed.
π Syntax
advanced2:00remaining
Identify the correct way to enqueue a stylesheet in a custom WordPress theme
Which code snippet correctly enqueues a stylesheet named 'style.css' in a custom WordPress theme's functions.php file?
Wordpress
<?php // Choose the correct code to enqueue style.css ?>
Attempts:
2 left
π‘ Hint
Look for the WordPress function designed to add stylesheets properly.
β Incorrect
The function wp_enqueue_style is used to add CSS files in WordPress themes. Using get_stylesheet_uri() gets the correct path to style.css.
π§ Debug
advanced2:00remaining
Why does a custom theme's changes not appear after editing header.php?
You edited the header.php file in your custom WordPress theme, but the site still shows the old header. What is the most likely reason?
Attempts:
2 left
π‘ Hint
Check if you edited the active theme's files or a different theme's files.
β Incorrect
If you edit a file in a theme folder that is not active, WordPress will not use those changes. Always edit files in the active theme directory.
β state_output
expert2:30remaining
What is the output of this WordPress loop in a custom theme?
Given this code snippet in a custom theme's index.php, what will it output if there are 3 published posts?
Wordpress
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; else : ?> <p>No posts found.</p> <?php endif; ?>
Attempts:
2 left
π‘ Hint
Consider how the WordPress loop works when posts exist.
β Incorrect
The loop runs once for each post found. For 3 posts, it outputs 3