page-home.php 4.03 KB
<?php get_header(); ?>
<div id="homepage-content">
    <header id="page-header">
        <a href="#" class="mobile-menu-btn" title="mobile-menu-btn">Mobile menu link</a>
        <div id="front-header">
            <?php wp_nav_menu(array(
                'theme_location' => 'main-nav',
                'container' => 'nav',
                'container_id' => 'primary-nav',
                'menu_class' => 'sf-menu',
                'walker' => new commonwell_walker_nav_menu

              )) ?>
            <?php wp_nav_menu(array(
                'theme_location' => 'main-nav',
                'container' => 'nav',
                'container_id' => 'primary-nav-mobile',
                'menu_class' => 'sf-click sf-vertical',
                'walker' => new commonwell_walker_nav_menu
            )) ?>
            <img class="menu-logo-bottom mobile-show"
         src="<?php bloginfo('template_directory'); ?>/images/ontario-mutuals-logo-143x86.jpg"
         width="143" height="86" alt="Ontario Mutuals Logo">
         <div class="mobile-show"><?php wp_nav_menu(array(
                    'theme_location' => 'secondary-nav',
                    'container'      => 'nav',
                    'container_id'   => 'menu-nav'
                    ))
             ?>
         </div>
        </div>
    </header>
    <?php if (has_post_thumbnail($post->ID)): ?>
        <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full-post-thumbnail');
        $img_id = get_post_thumbnail_id($post->ID);
        $alt_text = get_post_meta($img_id, '_wp_attachment_image_alt', true);
        $header_part_image_mobile = get_field('header_image_mobile');

        $videoEnableValue = get_field('enable_video', $post->ID, true);
        $enableVideo = !empty($videoEnableValue);

        if($enableVideo) : ?>
            <?php
                $videoType = get_field('video_type', $post->ID, true);
                $videoId = get_field('video_id', $post->ID, true);
            ?>

        <a href="#" class="video-play-button link-lightbox" data-videoid="<?php echo $videoId; ?>" data-videosite="<?php echo $videoType; ?>">
            <span class="play-arrow">Play button</span>
        </a>
            <div id="home-image">
                <img src="<?php echo $image[0]; ?>" width="1024" height="575" alt="<?php echo $alt_text; ?>" />
            </div>
        <?php else : ?>
            <div id="home-image">
                <img src="<?php echo $image[0]; ?>" width="1024" height="575" alt="<?php echo $alt_text; ?>" />
            </div>
        <?php endif; ?>

        <div class='header-image-mobile'>
            <img src='<?= (!empty($header_part_image_mobile)) ? $header_part_image_mobile['sizes']['large'] : "" ?>' />
        </div>

        <div id="transparency-content">
            <?php the_field('transparency_content'); ?>
        </div>
    <?php endif; ?>
    <!-- For blue menu list (Don't use for now)-->
    <?php
    // wp_nav_menu(array(
    // 	'theme_location' => 'main-nav',
    // 	'container'      => 'nav',
    // 	'container_id'   => 'blue-menu',
    // 	'link_before'     => ' [ ',
    // 	'link_after'      => ' ] ',
    // 	'menu_class' => 'blue-menu',
    // 	'depth'           => 1,
    // 	))
    ?>
</div>
<div class="front-page-bottom">
    <div id="first-page-logo">
        <a href="<?php bloginfo('url') ?>" title="<?php bloginfo('name') ?> - <?php bloginfo('description') ?>">
            <img id="frontpage-logo" src="<?php bloginfo('template_directory') ?>/images/Commonwell-logo.svg"
                 width="200" height="80" alt="Commonwell Mutual Insurance Group Logo" />
        </a>
    </div>
    <?php get_template_part('loop', 'home'); ?>
</div>
<script type="text/javascript">
    (function($) {
        $(document).ready(function() {
            $('.link-lightbox').simpleLightboxVideo();
        });
    })(jQuery);
</script>
<?php //get_sidebar(); ?>

<?php wp_nav_menu(
    array(
        'theme_location' => 'broker-footer',
        'container'      => 'nav',
        'container_id'   => 'broker-footer',
    )
);

?>
<?php get_footer(); ?>