<?php
/*
  Template Name: About
 */

get_header();

if (have_posts()) : while (have_posts()) : the_post();
$form_id=get_field('form_id');
$button_title=get_field('button_title');
$form_title=get_field('form_title');
$text_after_form=get_field('text_after_form');
        ?>
        <div id="body" class="page-row page-row-expanded">
            <div class="container">
                <div id="content">
                    <div class="entry">
                        <?php the_content(__('Read more', 'am')); ?>
                        <?php
                        if($form_id && $button_title):
                            echo '<p style="text-align:center;"><a class="btn big white popup_link" href="#booking">'.$button_title.'</a></p>';
                        endif;
                        ?>
                        <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
                    if($form_id):
                    ?>
                    <div id="booking" class="popup contact_form two-column">
                        <?php
                        if($form_title):
                        echo '<h2 class="popup_title">'.$form_title.'</h2>';
                        endif;
                        echo do_shortcode('[contact-form-7 id="'.$form_id.'"]');
                        if($text_after_form):
                            ?>
                        <div class="popup_footer">
                            <h3><?php echo $text_after_form; ?></h3>
                        </div>
                        <?php
                        endif;
                        ?>
                    </div>
                    <?php
                    endif;
                    ?>
                </div>
                <!-- / content -->

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

get_footer();
?>