Customizer Field, Edit Image, Dont display ALT text or use image sizes

When using the Wordpress smart action for customizer field and for editing an image:

The image on the front-end does not use:

  • WordPress responsive image sizes
  • ALT text from the media library

customize-field

Only generates this HTML on front-end:

If I’m not mistaken, WordPress only does the srcset and alt tag stuff for images referenced in the block editor. In the customizer, it just returns either the post ID of the image or the url.

Hi thanks for reply,

I feel there should be a way to then echo the alt text attribute if someone can help me out since I dont know a single line of php.

This is code from pinegrow:

<img src="<?php echo PG_Image::getUrl( get_theme_mod( 'blog_post_ad_image', esc_url( get_template_directory_uri() . '/media/images/blog/razor.jpg' ) ), 'large' ) ?>" class="single-post-wrapper__image-ad" loading="lazy"/>

I imagine you could do something like:

alt="<?php echo $alt_text_variable; ?>

I can live without the responsive images.