Complete the code to enable featured images in your WordPress theme.
add_theme_support([1]);Using add_theme_support('post-thumbnails') enables featured images in your theme.
Complete the code to display the featured image inside the post loop.
<?php if (has_post_thumbnail()) { the_[1](); } ?>
The function the_post_thumbnail() displays the featured image.
Fix the error in the code to get the URL of the featured image.
$url = get_the_[1]_url();The correct function is get_the_post_thumbnail_url() to get the featured image URL.
Fill both blanks to set a custom size for the featured image.
the_post_thumbnail([1], [2]);
Use 'thumbnail' as size name and an array for custom dimensions.
Fill all three blanks to add support for featured images and display one with a custom size.
<?php add_theme_support([1]); if (has_post_thumbnail()) { the_post_thumbnail([2], [3]); } ?>
First enable 'post-thumbnails', then display with size 'thumbnail' and custom dimensions.
