This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
home.php
154 lines (142 loc) · 6.07 KB
/
home.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php /* Template Name: Home */ ?>
<?php is_rest() ? : get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="container mod-home">
<?php
// Animation part 1
?>
<div class="row">
<div class="home-animation-1 col-12">
<div class="mod-animation animation" data-animation="home" data-autoplay="true" data-hover="false" data-loop="false"></div>
</div>
</div>
<?php
// Content Block 1
?>
<div class="row">
<div class="col-12">
<div class="home-content-block-1">
<div class="wysiwyg">
<?php the_content(); ?>
</div>
</div>
</div>
</div>
<?php
// Content Block 2
?>
<?php
$datetime = get_field( 'countdowndate', 'options' );
$is_future = $datetime - 7200 > wp_date( 'U' );
if ( $datetime && $is_future ): ?>
<div class="home-content-block-2">
<div class="row">
<div class="col">
<h2><?php _e( 'mova für', 'bula21' ); ?></h2>
</div>
</div>
<div class="row">
<div class="d-none col-sm-12 d-sm-flex">
<a href="<?php _e( 'Link Pfadis', 'bula21' ); ?>" class="block--item">
<div class="bg-black mod-animation animation" data-animation="gruppen" data-autoplay="false" data-loop="true" data-hover="true"></div>
<div class="bg-black choice-text"><p class="t-white"><?php _e( 'Pfadis', 'bula21' ); ?></p></div>
</a>
<a href="<?php _e( 'Link Helfende', 'bula21' ); ?>" class="block--item">
<div class="bg-yellow mod-animation animation" data-animation="helfende" data-autoplay="false" data-loop="true" data-hover="true"></div>
<div class="bg-yellow choice-text"><p><?php _e( 'Helfende', 'bula21' ); ?></p></div>
</a>
<a href="<?php _e( 'Link Externe', 'bula21' ); ?>" class="block--item">
<div class="bg-blue mod-animation animation" data-animation="externe" data-autoplay="false" data-loop="true" data-hover="true"></div>
<div class="bg-blue choice-text"><p><?php _e( 'Externe', 'bula21' ); ?></p></div>
</a>
</div>
<div class="col-12 d-sm-none">
<a href="<?php _e( 'Link Pfadis', 'bula21' ); ?>" class="block--item">
<div class="bg-red choice-text"><p><?php _e( 'Pfadis', 'bula21' ); ?></p></div>
</a>
<a href="<?php _e( 'Link Helfende', 'bula21' ); ?>" class="block--item">
<div class="bg-yellow choice-text"><p><?php _e( 'Helfende', 'bula21' ); ?></p></div>
</a>
<a href="<?php _e( 'Link Externe', 'bula21' ); ?>" class="block--item">
<div class="bg-blue choice-text"><p><?php _e( 'Externe', 'bula21' ); ?></p></div>
</a>
</div>
</div>
</div>
<div class="home-content-block-countdown" data-time="<?php echo wp_date( 'U', $datetime ); ?>">
<div class="row">
<div class="col">
<h2><?php _e( 'bis ins mova', 'bula21' ); ?></h2>
</div>
</div>
<div class="container">
<div class="row ">
<div class="col-12 col-md-3 bg-blue">
<div class="number days">
</div>
<div class="time-entity ">
<?php _e( 'Tage', 'bula21' ); ?>
</div>
</div>
<div class="col-12 col-md-3 bg-red">
<div class="number hours">
</div>
<div class="time-entity">
<?php _e( 'Stunden', 'bula21' ); ?>
</div>
</div>
<div class="col-12 col-md-3 bg-yellow">
<div class="number minutes">
</div>
<div class="time-entity">
<?php _e( 'Minuten', 'bula21' ); ?>
</div>
</div>
<div class="col-12 col-md-3 bg-black font-yellow">
<div class="number seconds">
</div>
<div class="time-entity">
<?php _e( 'Sekunden', 'bula21' ); ?>
</div>
</div>
</div>
</div>
</div>
<div class="home-content-block-countdown-liftoff d-none">
<iframe src="https://giphy.com/embed/QxHYo06xOo9cuyaEue"></iframe>
</div>
<?php endif; ?>
<?php
// Content Block 3 - News
$query = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => get_field( 'anzahl_posts' ),
'category__not_in' => get_field( 'hide_cat' ),
)
// maybe add max-number of posts, like:
// 'posts-per-page' => 3
// or add category-filter, like
// 'category_name' => 'news'
);
if ( $query->have_posts() ) {
?>
<div class="home-content-block-3">
<h2>News</h2>
<?php
while ( $query->have_posts() ) {
$query->the_post();
get_template_part( 'template-parts/content', 'news' );
}
?>
<div class="show-more-news">
<a href="<?php _e( '/news', 'bula21' ); ?>"><?php _e( 'Alle News anzeigen', 'bula21' ); ?></a>
</div>
</div>
<?php
}
wp_reset_query();
?>
</div>
<?php endwhile; endif; ?>
<?php is_rest() ? : get_footer(); ?>