0
0
Wordpressframework~20 mins

Responsive theme patterns in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Responsive Theme Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
component_behavior
intermediate
2:00remaining
How does the WordPress theme handle responsive images?
Given a WordPress theme using add_theme_support('responsive-embeds') and add_theme_support('post-thumbnails'), what is the expected behavior when displaying images in posts on different screen sizes?
AImages are replaced by low-resolution placeholders on mobile devices only.
BImages remain fixed size and may overflow the container on small screens.
CImages automatically scale to fit the container width, maintaining aspect ratio on all devices.
DImages are hidden on screens smaller than 600px width.
Attempts:
2 left
💡 Hint
Think about how WordPress handles image sizes and container widths with responsive support enabled.
📝 Syntax
intermediate
1:30remaining
Identify the correct CSS media query for mobile-first responsive design
Which CSS media query correctly applies styles only on screens wider than 768px, following mobile-first principles?
A@media only screen and (max-device-width: 768px) { /* styles here */ }
B@media (min-width: 768px) { /* styles here */ }
C@media screen and (width: 768px) { /* styles here */ }
D@media (max-width: 768px) { /* styles here */ }
Attempts:
2 left
💡 Hint
Mobile-first means starting with small screens and adding styles for larger screens.
🔧 Debug
advanced
2:30remaining
Why does the WordPress theme's navigation menu not collapse on small screens?
A WordPress theme uses a responsive navigation menu with a toggle button. On small screens, the menu stays expanded and the toggle button does not work. What is the most likely cause?
AThe JavaScript file controlling the toggle is not enqueued or has a syntax error.
BThe CSS media queries are missing the max-width condition for small screens.
CThe menu HTML lacks the required ARIA attributes for accessibility.
DThe theme does not declare support for responsive menus in functions.php.
Attempts:
2 left
💡 Hint
Check if the toggle button triggers any JavaScript and if the script is loaded correctly.
state_output
advanced
2:30remaining
What is the output of this WordPress theme function for responsive image sizes?
Consider this PHP code in a WordPress theme's functions.php:
function mytheme_setup() {
  add_theme_support('post-thumbnails');
  add_image_size('custom-size', 600, 400, true);
}
add_action('after_setup_theme', 'mytheme_setup');

// Later in template:
echo wp_get_attachment_image($attachment_id, 'custom-size');

What will be the size of the image rendered on a mobile device with a 320px wide screen?
Wordpress
function mytheme_setup() {
  add_theme_support('post-thumbnails');
  add_image_size('custom-size', 600, 400, true);
}
add_action('after_setup_theme', 'mytheme_setup');

// Later in template:
echo wp_get_attachment_image($attachment_id, 'custom-size');
AThe image will scale down responsively to fit the screen width, keeping aspect ratio.
BThe image will be cropped to 320x400 pixels on mobile devices.
CThe image will not display because 'custom-size' is not a default size.
DThe image will be 600x400 pixels regardless of screen size.
Attempts:
2 left
💡 Hint
Think about how WordPress image sizes and HTML image tags behave by default.
🧠 Conceptual
expert
3:00remaining
Which WordPress feature best supports responsive theme patterns for dynamic content?
You want your WordPress theme to automatically serve different image sizes and embed content responsively without extra coding. Which built-in WordPress feature is designed specifically for this?
AThe Responsive Images feature using srcset and sizes attributes.
BThe Customizer API for live previewing theme changes.
CThe REST API for fetching content asynchronously.
DThe Widget API for adding sidebar content.
Attempts:
2 left
💡 Hint
Focus on how WordPress handles images and embeds responsively by default.