Displaying Feature image section on WordPress

By default, there is no option on the feature image on the tab.

add below code on functions.php

add_theme_support( 'post-thumbnails' );

The line add_theme_support( ‘post-thumbnails’ ); is a WordPress function used to enable support for featured images, also known as post thumbnails, in your WordPress theme.

Here’s a breakdown of what each part of the line does:

  • add_theme_support: This is a WordPress function used to add various features or functionalities to your theme. It allows themes to declare support for specific features in WordPress.
  • ‘post-thumbnails’: This is the feature that we are adding support for. In this case, it enables support for featured images, also called post thumbnails. Once enabled, you can associate an image with each post or custom post type, which can then be displayed in various parts of your theme, such as on the post itself or in post listings.
  • By using add_theme_support( ‘post-thumbnails’ );, you’re telling WordPress that your theme supports featured images.

After adding this line to your theme’s functions.php file, WordPress will provide the necessary functionality for you to add and display featured images in your posts and custom post types.