-
Notifications
You must be signed in to change notification settings - Fork 0
/
homepage.php
395 lines (376 loc) · 14.1 KB
/
homepage.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
<?php
/*
Template Name: Homepage
*/
?>
</div><!-- / .row -->
</div><!-- / .container -->
<?php function get_trim_text ($string) {
$maxlen = 180;
$excerpt = $string;
$excerptlen = strlen($excerpt);
if ($excerptlen > $maxlen) {
$excerpt = substr($excerpt, 0, $maxlen).'...';
$excerptlen = $maxlen + 3;
}
if ($excerpt[0] == '"')
$excerpt = substr($excerpt, 0, $excerptlen-1);
return $excerpt;
}?>
<div class="sigla feeds-hero">
<div class="container">
<div class="row feeds-hero__row">
<h3 class="half-black">
Accurate information is the foundation of a functioning democracy
</h3>
</div>
</div>
</div>
<div class="feeds-aim overflow-hidden">
<div class="container"><div class="feeds-container">
<p class="feeds-aim__container__img col col-2"> WHAT WE DO </p>
<p class="feeds-aim__container__text col col-10">
Science Feedback is a worldwide network of scientists sorting fact from fiction in science based media coverage. Our goal is to help readers know which news to trust. </p>
</div></div>
</div>
<div class="container"> <!-- Claim review Climate-->
<?php
//Extract ID from category name
$theCatId2 = get_term_by( 'slug', 'climate', 'category' );
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('claimreview'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$posts = new WP_Query( $args );
?>
<div class="feeds-container feeds-container__claim ">
<div class="feeds-title h3">Latest Claim Reviews – CLIMATE</div>
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
<a href="https://climatefeedback.org/claimreview/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class="feed feed__claim col col-lg-6 mb1">
<div class="feed__claim__container relative">
<div class="feed__claim__container__illustration col col-4">
<div class="feed__claim__container__illustration__screenshot">
<img
class="feed__claim__container__illustration__screenshot__img"
src="<?php echo get_post_meta( get_the_ID(), 'screenshot', true)?>"
>
</div>
</div>
<div class="feed__claim__container__content col col-8">
<img
class="feed__claim__container__content__verdict__img mb1"
src="<?php echo get_site_url(); ?>/wp-content/uploads/tags/HTag_<?php echo get_post_meta( get_the_ID(), 'verdict', true)?>.png"
>
<div class="feed-excerpt feed__claim__container__content__text mb1">
<?php echo get_post_meta( get_the_ID(), 'claimshort', true); ?>
</div>
<div class="feed__claim__container__content__outlet">
<?php echo get_post_meta( get_the_ID(), 'author', true); ?>, <?php echo get_post_meta( get_the_ID(), 'outlet', true); ?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more mb1 p1">
<a class="feeds-more__link h4 p1" href="https://climatefeedback.org/claim-reviews/">
More Climate Claim Reviews
</a>
</div>
</div><!-- / .container -->
<div class="container"> <!-- Claim review Health-->
<?php
//Extract ID from category name
$theCatId2 = get_term_by( 'slug', 'health', 'category' );
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('claimreview'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$posts = new WP_Query( $args );
?>
<div class="feeds-container feeds-container__claim ">
<div class="feeds-title h3">Latest Claim Reviews – HEALTH</div>
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
<a href="https://healthfeedback.org/claimreview/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class="feed feed__claim col col-lg-6 mb1">
<div class="feed__claim__container relative">
<div class="feed__claim__container__illustration col col-4">
<div class="feed__claim__container__illustration__screenshot">
<img
class="feed__claim__container__illustration__screenshot__img"
src="<?php echo get_post_meta( get_the_ID(), 'screenshot', true)?>"
>
</div>
</div>
<div class="feed__claim__container__content col col-8">
<img
class="feed__claim__container__content__verdict__img mb1"
src="<?php echo get_site_url(); ?>/wp-content/uploads/tags/HTag_<?php echo get_post_meta( get_the_ID(), 'verdict', true)?>.png"
>
<div class="feed-excerpt feed__claim__container__content__text mb1">
"<?php echo get_post_meta( get_the_ID(), 'claimshort', true); ?>"
</div>
<div class="feed__claim__container__content__outlet">
<?php echo get_post_meta( get_the_ID(), 'author', true); ?>, <?php echo get_post_meta( get_the_ID(), 'outlet', true); ?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more mb1 p1">
<a class="feeds-more__link h4 p1" href="https://healthfeedback.org/claim-reviews/">
More Health Claim Reviews
</a>
</div>
</div><!-- / .container -->
<div class="container"> <!-- Article reviews Climate-->
<?php
//Extract ID from category name
$theCatId2 = get_term_by( 'slug', 'climate', 'category' );
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('evaluation'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$loop = new WP_Query( $args );
?>
<div class="feeds-container">
<div class="feeds-title h3">Latest Article Reviews - CLIMATE</div>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="col col-lg-6" href="https://climatefeedback.org/evaluation/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class='feed feed__article mb3'>
<div class='feed__article-next__screenshot mb1'>
<img
class='feed__article-next__screenshot__img'
src="<?php echo simplexml_load_string(get_the_post_thumbnail())->attributes()->src;?>"
>
</div>
<div class='feed-title h3'>
<?php echo get_the_title(); ?>
</div>
<div class='feed-outlet h3'>
<?php echo get_post_meta( get_the_ID(), 'outlet', true); ?>
</div>
<div class='feed-excerpt mb1'>
<?php echo get_trim_text(get_the_excerpt());?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more mb1 p1">
<a class="feeds-more__link h4 p1" href="https://climatefeedback.org/feedbacks/">
More Climate Article Reviews
</a>
</div>
</div><!-- / .container -->
<div class="container"> <!-- Article reviews Health-->
<?php
//Extract ID from category name
$theCatId2 = get_term_by( 'slug', 'health', 'category' );
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('evaluation'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$loop = new WP_Query( $args );
?>
<div class="feeds-container">
<div class="feeds-title h3">Latest Article Reviews - HEALTH</div>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="col col-lg-6" href="https://healthfeedback.org/evaluation/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class='feed feed__article mb3'>
<div class='feed__article-next__screenshot mb1'>
<img
class='feed__article-next__screenshot__img'
src="<?php echo simplexml_load_string(get_the_post_thumbnail())->attributes()->src;?>"
>
</div>
<div class='feed-title h3'>
<?php echo get_the_title(); ?>
</div>
<div class='feed-outlet h3'>
<?php echo get_post_meta( get_the_ID(), 'outlet', true); ?>
</div>
<div class='feed-excerpt mb1'>
<?php echo get_trim_text(get_the_excerpt());?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more mb1 p1">
<a class="feeds-more__link h4 p1" href="https://healthfeedback.org/feedbacks/">
More Health Article Reviews
</a>
</div>
</div><!-- / .container -->
<div class="container"><!-- Insight Climate-->
<div class="feeds-title h3">Latest Insight articles – CLIMATE</div>
<?php
$theCatId2 = get_term_by( 'slug', 'climate', 'category' ); //only insight posts tagged with climate or health
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('post'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$loop = new WP_Query( $args );
?>
<div class="feeds-container mr3 p1">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="col col-lg-6" href="https://climatefeedback.org/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class='feed feed__perspective mb1 p2'>
<div class='feed__perspective__screenshot mb1'>
<img
class='feed__perspective__screenshot__img'
src="<?php echo simplexml_load_string(get_the_post_thumbnail())->attributes()->src;?>"
>
</div>
<div class='feed-title h3'>
<?php echo get_the_title(); ?>
</div>
<div class='feed-excerpt mb1'>
<?php echo get_trim_text(get_the_excerpt());?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more p1 mb1">
<a class="feeds-more__link h4 p1" href="https://climatefeedback.org/insights/">
More Climate Insights
</a>
</div>
</div><!-- / .container -->
<div class="container"><!-- Insight Health-->
<div class="feeds-title h3">Latest Insight articles – HEALTH</div>
<?php
$theCatId2 = get_term_by( 'slug', 'health', 'category' ); //only insight posts tagged with climate or health
$theCatId2 = $theCatId2->term_id;
$args = array(
'post_type' => array('post'),
'cat' => $theCatId2,
'posts_per_page' => 2
);
$loop = new WP_Query( $args );
?>
<div class="feeds-container mr3 p1">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="col col-lg-6" href="https://healthfeedback.org/<?php echo basename(get_permalink( get_the_ID() )); ?>" >
<div class='feed feed__perspective mb1 p2'>
<div class='feed__perspective__screenshot mb1'>
<img
class='feed__perspective__screenshot__img'
src="<?php echo simplexml_load_string(get_the_post_thumbnail())->attributes()->src;?>"
>
</div>
<div class='feed-title h3'>
<?php echo get_the_title(); ?>
</div>
<div class='feed-excerpt mb1'>
<?php echo get_trim_text(get_the_excerpt());?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more p1 mb1">
<a class="feeds-more__link h4 p1" href="https://healthfeedback.org/insights/">
More Health Insights
</a>
</div>
</div><!-- / .container -->
<div class="container">
<div class="feeds-title h3">News & Events</div>
<?php
$theCatId = get_term_by( 'slug', 'news', 'category' );
$theCatId = $theCatId->term_id;
$args = array(
'post_type' => array( 'post', 'press' ),
'cat' => $theCatId,
'posts_per_page' => 2
);
$loop = new WP_Query( $args );
?>
<div class="feeds-container mr3 p1">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a class="col col-lg-6" href="<?php echo get_permalink( get_the_ID() ); ?>" >
<div class='feed feed__perspective mb1 p2'>
<div class='feed__perspective__screenshot mb1'>
<img
class='feed__perspective__screenshot__img'
src="<?php echo simplexml_load_string(get_the_post_thumbnail())->attributes()->src;?>"
>
</div>
<div class='feed-title h3'>
<?php echo get_the_title(); ?>
</div>
<div class='feed-excerpt mb1'>
<?php echo get_trim_text(get_the_excerpt());?>
</div>
<div>
- <?php echo get_the_date( 'd M Y' ); ?>
</div>
</div>
</a>
<?php endwhile; ?>
</div>
<div class="feeds-more p1 mb3">
<a
class="feeds-more__link h4 p1"
href="https://sciencefeedback.co/news-events/"
>
More News & Events
</a>
</div>
</div><!-- / .container -->
<!-- Press
<section class="press-show">
<div class="container">
<h3 style="font-size: 1.25rem;">Hear what they are saying about us</h3>
<div class="row">
<div class="col-4" style="padding-left: 1em; padding-right: 1em">
<a href="/press/annotation-might-future-fact-checking/" target="_blank"> <img class="press-fig img-responsive" src="<?php echo get_stylesheet_directory_uri(); ?>/dist/images/ps-Poynter.png"> </a>
</div>
<div class="col-4">
<a href="/press/scientists-get-tool-to-mark-online-climate-science-media-coverage-and-its-not-a-rusty-teaspoon/" target="_blank"> <img class="press-fig img-responsive" src="<?php echo get_stylesheet_directory_uri(); ?>/dist/images/the-guardian-logo_grey.png"></a>
</div>
<div class="col-4 forbes" style="padding-left: 2em">
<a href="/press/climate-scientists-launch-brainy-attack-inaccurate-news/" target="_blank"> <img class="press-fig img-responsive" src="<?php echo get_stylesheet_directory_uri(); ?>/dist/images/ps-Forbes.png"></a>
</div>
<div class="col-4">
<a href="https://sciencefeedback.co/press-coverage/" class="btn btn-primary">More Press</a>
</div>
</div>
</div>
</section>
-->