Screening Entry Level

How do featured images (post thumbnails) work in WordPress? How do you enable them, register custom image sizes, and display them in templates?

Quick Tip

Cover the full workflow: "Enable with add_theme_support, register custom sizes with add_image_size, display with the_post_thumbnail. After adding sizes to an existing site, I regenerate thumbnails with WP-CLI: wp media regenerate."

What good answers include

Enable featured image support with add_theme_support('post-thumbnails') in functions.php. Register custom image sizes with add_image_size(name, width, height, crop). WordPress generates the registered sizes when an image is uploaded. Display in templates with the_post_thumbnail(size) inside The Loop, or get_the_post_thumbnail_url(post_id, size) for the URL. Default sizes: thumbnail, medium, large, full. Strong candidates explain: that sizes are generated at upload time (not on the fly), the regenerate thumbnails process needed after adding new sizes, the srcset attribute WordPress adds automatically for responsive images, and how to control which sizes appear in the media inserter with the image_size_names_choose filter.

What interviewers are looking for

Basic theme development knowledge. Candidates who hardcode image dimensions or do not register proper sizes will produce themes with poorly sized images. Those who understand the thumbnail generation pipeline and responsive srcset output build performant image-heavy sites.

← All WordPress questions