-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-front-page.php
118 lines (79 loc) · 3.59 KB
/
page-front-page.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
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
109
110
111
112
113
114
115
116
117
118
<?php
/*
* Template Name: Front Page
* Description: Big front page
*/
?>
<?php get_header(); ?>
<div class="custom-container">
<?php $one = get_theme_mod('front-page-layout-display');?>
<!--If user wants to display Background Mode-->
<?php if ( $one == 'Yes') { ?>
<section class="front-page-layout big">
<div class="front-text-container">
<h1>
<?php echo get_theme_mod('front-page-layout-heading'); ?>
</h1>
<p>
<?php echo get_theme_mod('front-page-layout-text'); ?>
</p>
<a href="<?php echo get_theme_mod('custom-link-booking-url'); ?>" title="bokadirekt" target="_blank">
<img class="bokadirekt" src="https://foretag.bokadirekt.se/bokatid/BokaTid_Vit_MorkBakgrund_120px.png" alt="Boka tid" border="0" />
</a>
</div>
</section>
<?php } ?>
<?php if ( $one == 'No') { ?>
<section class="front-page-layout">
<div class="front-container">
<div class="front-page-layout-text">
<h1>
<?php echo get_theme_mod('front-page-layout-heading'); ?>
</h1>
<p>
<?php echo get_theme_mod('front-page-layout-text'); ?>
</p>
<a href="<?php echo get_theme_mod('custom-link-booking-url'); ?>" title="bokadirekt" target="_blank">
<img class="bokadirekt" src="https://foretag.bokadirekt.se/bokatid/BokaTid_Vit_MorkBakgrund_120px.png" alt="Boka tid" border="0" />
</a>
</div>
<div class="front-page-layout-image">
<!--not only return a numeric id-number for the image, but the actual url-->
<img src="<?php echo esc_url( get_theme_mod( 'front-page-layout-image' )); ?>">
</div>
</div>
</section>
<?php } ?>
<!--Section for pages with two columns-->
<section class="intro-text">
<?php
$args = array('post_type' => 'front-page-posts', 'post_per_page' => -1);
$loop = new WP_Query( $args );
if( $loop->have_posts()) :
$i = 1;
while( $loop->have_posts()) : $loop->the_post(); ?>
<div class="text-center">
<h2>
<?php the_title(); ?>
</h2>
<p>
<?php the_content(); ?>
</p>
</div>
<?php $i++;
endwhile;
else : ?>
<p>
<?php __('No Post Found'); ?>
</p>
<?php endif;
//now wp is the boss again
wp_reset_postdata();
?>
</section>
<!--get text-boxes.php-->
<?php get_template_part('parts/image-text-boxes'); ?>
<!--get reference-boxes.php-->
<?php get_template_part('parts/reference-boxes'); ?>
</div><!-- /.custom-container -->
<?php get_footer(); ?>