Aj Khandal
This is very common thing to get an image on page or post. To get an image on template we can use pre-defined function from WordPress library.
wp_get_attachment_image( int $attachment_id, string|array $size = ‘thumbnail’, bool $icon = false, string|array $attr = ” )
Parameters #Parameters –
$attr – string|array) (Optional) Attributes for the image markup.
Default value: ”
This function only gets an image that was uploaded to WordPress, it doesn’t output an image in the content of the post.