page-home.php
4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?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(); ?>