<?php
/*
  Template Name: Contact
 */

get_header();

if (have_posts()) : while (have_posts()) : the_post();
        ?>
        <div id="body" class="page-row page-row-expanded">
            <div class="container">
                <div class="page-title">
                    <h1><?php the_title(); ?></h1>
                </div>
                <div id="content">
                    <div class="entry">
                        <?php the_content(__('Read more', 'am')); ?>
                        <div class="clear clearfix"></div>
                        <?php wp_link_pages(array('before' => '<div class="page-link"><p><span>' . __('Pages:', 'am') . '</span>', 'after' => '</p></div>')); ?>
                        <?php edit_post_link(__('Edit', 'am'), '<br /><p>', '</p>'); ?>
                    </div>
                    <?php
                    $map = get_field('map');
                    if ($map):
                        ?>
                        <div class="map-holder">
                            <div id="map"></div>
                        </div>
                        <?php
                    endif;
                    $contact_form_id = get_field('contact_form_id');
                    if ($contact_form_id):
                        ?>
                        <div class="contact_form two-column">
                            <?php echo do_shortcode('[contact-form-7 id="' . $contact_form_id . '"]'); ?>
                        </div>
                        <?php
                    endif;
                    ?>
                </div>
                <!-- / content -->

            </div>
            <!-- / container -->
        </div>
        <?php
    endwhile;
endif;

get_footer();
?>