<?php
/**
 * Partial template to display header ads.
 *
 * @package Ogma
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$header_ads_image = ogma_get_customizer_option_value( 'header_ads_image' );

if ( empty( $header_ads_image ) || 0 == $header_ads_image ) {
    return;
}

$header_ads_image_link = ogma_get_customizer_option_value( 'header_ads_image_link' );
$ads_image_src = wp_get_attachment_image( $header_ads_image, 'full' );
?>

<div class="ogma-header-ads-wrap">
    <a href="<?php echo esc_url( $header_ads_image_link ); ?>">
        <?php echo wp_kses_post( $ads_image_src ); ?>
    </a>
</div><!-- .ogma-header-ads-wrap -->