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
<?php
get_header();
$meta = get_post_meta( $post->ID, 'offshore_options', true );
$page_template = get_theme_mod( 'page_template', 'right-sidebar' );
if( !isset( $meta['template'] ) ){
$meta['template'] = 'global';
}
$column = 'col-md-9';
if( 'full-width' == $page_template && $meta['template'] == 'global' ){
$column = 'col-md-12';
} elseif( $meta['template'] == 'full-width' ) {
$column = 'col-md-12';
}
?>
<div class="row">
<?php
if( 'left-sidebar' == $page_template && $meta['template'] == 'global' ){
get_sidebar();
} elseif( $meta['template'] == 'left-sidebar' ) {
get_sidebar();
}
if( 'no-sidebar' == $page_template && $meta['template'] == 'global' ) {
$column = 'col-md-12';
} elseif( $meta['template'] == 'no-sidebar' ) {
$column = 'col-md-12';
}
?>
<div class="<?php echo $column; ?>">
<?php
// Remove the section tag if a page is set as the front page
if( !is_home() && !is_front_page() ){
echo '<section>';
}
offshore_content_top();
get_template_part( 'parts/content', 'page' );
offshore_content_bottom();
// Remove the section tag if a page is set as the front page
if( !is_home() && !is_front_page() ){
echo '</section>';
}
?>
</div>
<?php
if( 'right-sidebar' == $page_template && $meta['template'] == 'global' ) {
get_sidebar();
} elseif( $meta['template'] == 'right-sidebar' ) {
get_sidebar();
}
?>
</div>
<?php
offshore_content_after();
get_footer();
?>