
<?php $post_id = get_the_ID(); ?>

<a class="banner-main-page" href="<?php echo carbon_get_post_meta( $post_id, 'main_banner_link' ) ?>">
	<?php $foto = carbon_get_post_meta( $post_id, 'main_banner_img_desktop' ); ?>
	<?php $foto_mobile = carbon_get_post_meta( $post_id, 'main_banner_img_mobile' );
	if ($foto_mobile == '') $foto_mobile = $foto;
	if ($foto != '') {?>
	<picture class="banner-main-page_img">
		<source srcset="<?php echo wp_get_attachment_url($foto); ?>" media="(min-width: 780px)">
		<img src="<?php echo wp_get_attachment_url($foto_mobile); ?>" alt="<?php echo get_post_meta( $foto, '_wp_attachment_image_alt', true ); ?>">
	</picture>
	<?php } ?>
</a>