forked from City-of-Helsinki/wordpress-helfi-spouse-program
-
Notifications
You must be signed in to change notification settings - Fork 0
/
two-column-template.php
74 lines (66 loc) · 2.17 KB
/
two-column-template.php
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: Two-column-template */ ?>
<?php get_header(); ?>
<?php ?>
<?php if(get_field('additional_graphical_elements')): ?>
<main id="main-content" class="container-fluid sidewave" style="background-image:url(<?php echo get_template_directory_uri(); ?>/src/scss/icons/sidedecoration.svg)" role="main">
<?php else: ?>
<main id="main-content" class="container-fluid" role="main">
<?php endif; ?>
<div class="row">
<?php if($thumbnail = get_the_post_thumbnail_url(get_the_ID(), 'full')): ?>
<div class="col-12 hero-image"style='background-image:url(<?php echo $thumbnail; ?>);'>
<img role="presentation" alt="" class="wave " src="<?php echo get_template_directory_uri(); ?>/src/scss/icons/background-white-horizontal.svg">
</div>
<?php endif; ?>
<div class="col-12">
<?php
if (have_posts()) :
while (have_posts()) :
the_post();
?>
<h1><?php echo get_the_title(); ?></h1>
<?php
endwhile;
endif;
?>
</div>
<div class="col-10 offset-1 col-lg-5 offset-lg-1">
<?php
// left column
if( have_rows('left_column_content') ):
echo '<div class="row">';
while ( have_rows('left_column_content') ) : the_row();
$type = get_sub_field('content_type');
get_template_part('partials/'.$type);
endwhile;
echo '</div>';
endif;
?>
</div>
<div class="col-10 offset-1 offset-lg-0 col-lg-5">
<?php
// right column
if( have_rows('right_column_content') ):
echo '<div class="row">';
while ( have_rows('right_column_content') ) : the_row();
$type = get_sub_field('content_type');
get_template_part('partials/'.$type);
endwhile;
echo '</div>';
endif;
?>
</div>
</div>
<?php
// show social sharing only if the page is not behind login
if( ! spouse_is_restricted_page()):
?>
<div class="row social-icon-bar">
<div class="col-6 mx-auto text-center">
<span class="social-title"><?php dynamic_sidebar( 'social_title' ); ?></span>
<?php echo do_shortcode('[SHARING_PLUS]'); ?>
</div>
</div>
<?php endif; ?>
</main>
<?php get_footer(); ?>