0
0
Wordpressframework~20 mins

First WordPress site - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WordPress Site Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
What happens when you activate a new WordPress theme?

After installing and activating a new WordPress theme, what is the immediate visible effect on your website?

AThe WordPress dashboard becomes inaccessible until you deactivate the theme.
BAll existing posts and pages are deleted automatically.
CThe website's design and layout change to match the new theme's style.
DThe website's URL changes to a new address.
Attempts:
2 left
💡 Hint

Think about what a theme controls in WordPress.

📝 Syntax
intermediate
2:00remaining
Which WordPress function correctly includes the header template?

In a WordPress theme's template file, which function call correctly includes the header part of the site?

Aget_header();
Binclude_header();
Cload_header();
Dheader_include();
Attempts:
2 left
💡 Hint

WordPress has specific functions for template parts starting with 'get_'.

state_output
advanced
2:00remaining
What is the output of this WordPress loop code snippet?

Consider this WordPress loop snippet inside a theme template:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  <h2><?php the_title(); ?></h2>
<?php endwhile; else : ?>
  <p>No posts found.</p>
<?php endif; ?>

If there are no posts published, what will this code output?

AA PHP error will occur because the_post() is called without posts.
BNothing will be displayed on the page.
C<h2></h2> repeated for each post.
D<p>No posts found.</p>
Attempts:
2 left
💡 Hint

Look at the else part of the if statement.

🔧 Debug
advanced
2:00remaining
Why does this WordPress shortcode not display content?

Given this shortcode function in functions.php:

function my_shortcode() {
  return 'Hello, world!';
}
add_shortcode('greet', 'my_shortcode');

When you add [greet] in a post, nothing appears. What is the likely cause?

AThe theme does not call <code>the_content()</code> to process shortcodes.
BThe shortcode is not registered because add_shortcode is missing a priority argument.
CThe shortcode function must echo, not return, the string.
DShortcodes only work in widgets, not in posts.
Attempts:
2 left
💡 Hint

Shortcodes need to be processed inside the content output.

🧠 Conceptual
expert
3:00remaining
What is the role of the WordPress REST API in modern site development?

Which statement best describes the main purpose of the WordPress REST API?

AIt replaces the WordPress database with a NoSQL system for faster queries.
BIt allows external applications to read and write WordPress content using HTTP requests.
CIt automatically updates WordPress plugins and themes without user input.
DIt converts PHP templates into static HTML files for faster loading.
Attempts:
2 left
💡 Hint

Think about how apps or other websites might interact with WordPress data.