<?php
/**
 * Advertise
 *
 * @package NewsNation
 */

function newsnation_advertise_block( $newsnation_home_section ,$repeat_times){ 

	$advertise_image = esc_html( isset($newsnation_home_section->advertise_image) ? $newsnation_home_section->advertise_image : '');
	$advertise_link = esc_html( isset($newsnation_home_section->advertise_link) ? $newsnation_home_section->advertise_link : '');
	if( $advertise_image ){
	?>
	<div id="theme-block-<?php echo esc_attr($repeat_times); ?>" class="theme-block theme-block-ava">
	    <div class="wrapper">
            <a href="<?php echo esc_url($advertise_link); ?>" target="_blank" class="home-lead-link">
                <img src="<?php echo esc_url($advertise_image); ?>" alt="<?php esc_attr_e('Advertise Image', 'newsnation'); ?>">
            </a>
		</div>
	</div>

	<?php
	}
	
} 