page.php
2.48 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
<?php
/*
* Template Name: Broker Pages
*/
global $user_ID;
wp_get_current_user();
if (!$user_ID) {
auth_redirect();
}
?>
<?php get_header("brokerlanding");
global $wpdb;
?>
<div id="brokercontent">
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<div class="header-image" id="header-image" style="background-image: url(<?php echo $image[0]; ?>);"></div>
<?php
$mobile_image = get_field('mobile_header_image');
if($mobile_image) {
?>
<div class="header-image" id="mobile-header-image" style="background-image: url(<?= $mobile_image['url']; ?>);"></div>
<?php
}
?>
<?php endif; ?>
<div id="page-content">
<?php
if (function_exists("clean_custom_menus")) {
clean_custom_menus();
}
?>
<div class='inner-content-wrapper'>
<?php
$sidebar_content = null;
?>
<!-- CHECK IF THIS PAGE HAS A MENU -->
<?php ob_start(); include_once 'templates/menu-sidebar.php'; $sidebar_content = ob_get_clean(); ?>
<!-- CHECK IF THIS IS THE HOMEPAGE.. DISPLAY THE CONTACTS -->
<?php if(is_front_page()) { ?>
<?php ob_start(); include_once 'templates/broker_sidebar.php'; $sidebar_content .= ob_get_clean(); ?>
<?php } ?>
<!-- CHECK IF THIS PAGE HAS A SEARCH MODULE -->
<?php ob_start(); include_once 'templates/search-sidebar.php'; $sidebar_content .= ob_get_clean(); ?>
<?php if(!empty(trim($sidebar_content))) { $mobile_label = get_field('side_menu_mobile_label'); ?>
<div class='sidebar-pullout'>
<span class='sidebar-title'><?= (!empty($mobile_label)) ? $mobile_label : __("Your Commonwell Team") ?></span>
<button class='pullout-btn'></button>
</div>
<div class='sidebar'><?= $sidebar_content ?></div>
<?php } ?>
<div class='article-wrapper <?= (!empty(trim($sidebar_content)))?'has-sidebar':'' ?>'>
<?php get_breadcrumb() ?>
<?php get_template_part('loop', 'single');?>
</div>
<div class='the-topper hide'>
<a href='#'>Go to Top</a>
</div>
</div>
</div>
</div>
<?php get_footer();?>