<?php
/**
 * The template for displaying all single posts.
 *
 * @package rst
 */

 /* Template Name: Contact Page */ 
get_header(); ?>
	<!-- Page Title
	====================================-->
	<div class="container">
			<?php 
				$rst_background_title = rs::getField('rst_background_headline',$post->ID,'image','url');
				if( $rst_background_title ){
					$header_bg = esc_url($rst_background_title);
				}else{
					if( get_theme_mod('bg_general_headline_background') || get_theme_mod('bg_headline_background_page') || (get_theme_mod('bg_general_headline_background') && get_theme_mod('bg_headline_background_page')) ){
						if( get_theme_mod('bg_headline_background_page') ) { 
							$header_bg = esc_url(get_theme_mod('bg_headline_background_page'));
						}else{
							$header_bg = get_theme_mod('bg_general_headline_background');
						}
					}else {
						$header_bg = get_template_directory_uri() . '/img/bg_headline.jpg';
					}
				}
			?>
		 <div id="tf-page-header" class="header-bg" data-bg="<?php echo esc_html($header_bg); ?>">
            <h5><?php rst_the_translate('do you have any questions?','translation_contact_questions') ?></h5>
            <hr>
            <h2><?php the_title(); ?></h2>
        </div>
	</div>
	<!-- Blog Body 
    ====================================-->
    <div id="tf-content" class="contact">
        <div class="container"><!-- Container -->
            <div class="row"><!-- Row -->
				<div class="col-md-10 col-md-offset-1"> <!-- About us content -->
					<?php while ( have_posts() ) : the_post(); ?>
						<?php get_template_part( 'content', 'contact' ); ?>
					<?php endwhile; // end of the loop. ?>
				</div>
			</div><!-- end Row -->
        </div><!-- End Container -->
    </div>
	<!-- Map -->	
	<?php
		if( rs::getField('rst_address_thumbnail',$post->ID,'image','url') ){
			$market = rs::getField('rst_address_thumbnail',$post->ID,'image','url');
		}else{
			$market = get_template_directory_uri().'/img/marker.png';
		}
	?>
	<?php
		if(rs::getField('rst_address',$post->ID) && rs::getField('rst_address',$post->ID) != ''){
	?>
	<div id="map" data-center="<?php echo rs::getField('rst_address',$post->ID); ?>" data-image="<?php echo $market; ?>" class="rst-contact-maps"> </div>
	<?php
		}else{
	?>
		<div style="display: none;" id="map" data-center="" data-image="<?php echo $market; ?>" class="rst-contact-maps"> </div>
	<?php
		}
	?>
<?php get_footer(); ?>
