Repository navigation
Expand file tree
/
Copy pathfront-page.php
More file actions
82 lines (79 loc) · 2.12 KB
/
Copy pathfront-page.php
File metadata and controls
82 lines (79 loc) · 2.12 KB
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
<?php
get_header(); ?>
<div id="currentwx">
<h2>Currently</h2>
<?php do_action("wxpress_observations"); ?>
</div>
<?php do_action("chswx_updates"); ?>
<?php do_action("wxpress_alerts"); ?>
<?php
$disco_args = [
"post_type" => "post",
"limit" => 1,
"category_name" => "Forecasts",
"tax_query" => [
[
"taxonomy" => "post_format",
"field" => "slug",
"terms" => ["post-format-aside", "post-format-status"],
"operator" => "NOT IN",
],
],
"date_query" => [
[
"after" => "-18 hours",
],
],
];
$disco_query = new WP_Query($disco_args);
if ($disco_query->have_posts()) { ?>
<div class="blog-intro">
<h2>Charleston Weather Discussion</h2>
<p class="intro-text">The latest forecast and discussion for the Charleston, SC metro area</p>
<?php
$disco_query->the_post();
get_template_part("template-parts/part", "post");
?>
</div><?php wp_reset_postdata();}
?>
<div id="forecast">
<h2>Charleston Area <abbr title="National Weather Service">NWS</abbr> Forecast</h2>
<?php do_action("wxpress_forecast"); ?>
</div>
<?php
// Query for recent non-forecast blog posts.
$blog_args = [
"post_type" => "post",
"limit" => 1,
"tax_query" => [
[
"taxonomy" => "post_format",
"field" => "slug",
"terms" => ["post-format-aside", "post-format-status"],
"operator" => "NOT IN",
],
[
"taxonomy" => "category",
"field" => "slug",
"terms" => ["Forecasts"],
"operator" => "NOT IN",
],
],
"date_query" => [
[
"after" => "-3 days",
],
],
];
$blog_query = new WP_Query($blog_args);
if ($blog_query->have_posts()) { ?>
<div class="blog-intro">
<h2>More from the Blog</h2>
<p class="intro-text">Weather tidbits and other useful info</p>
<?php
$blog_query->the_post();
get_template_part("template-parts/part", "post");
?>
</div><?php wp_reset_postdata();}
?>
<?php get_footer();