This repository has been archived by the owner on Jan 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate-frontpage.php
155 lines (129 loc) · 4.93 KB
/
template-frontpage.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
<?php
/*
Template Name: Frontpage
Description: A section based template used for website frontpage.
*/
//Get visualizations for use later in the page to build content/nav
$viz_ids = get_posts(array(
'fields' => 'ids',
'posts_per_page' => -1,
'post_type' => 'tji_viz',
'orderby' => 'menu_order',
'order' => 'ASC'
));
$viz_args = array(
'post_type' => 'tji_viz',
'orderby' => 'menu_order',
'order' => 'ASC',
'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1,
'posts_per_page' => -1 // remove if loading via AJAX
);
$viz_query = new WP_Query( $viz_args );
?>
<?php get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<!-- The initial landing screen -->
<section id="hero" class="tji-section">
<?php
//A unique splash screen
include( locate_template( 'template-parts/homepage-landing.php' ) );
?>
<div class="read-more">
<img src="<?php echo get_template_directory_uri(); ?>/img/home_arrow.png">
</div>
</section><!-- #hero -->
<!-- Story navigation icons -->
<section id="tji-story-nav" class="tji-section">
<div class="tji-story-start">
<span class="tji-tagline">What do we know about those deaths?</span>
<hr class="tji-divider">
<p>Choose a topic below to learn more, or scroll down to start from the beginning.</p>
</div>
<!-- Landing page navigation panels -->
<div id="tji-nav-main" class="nav-container">
<?php
//echo '<pre>' . print_r( $viz_ids, true ) . '</pre>';
//Loop through each story and build a panel for each
foreach ($viz_ids as $id) {
$title = get_the_title( $id );
$slug = get_post_field('post_name', $id);
?>
<div class="tji-nav-child">
<a href="#<?php echo $slug; ?>" class="viz-link">
<img src="<?php echo get_the_post_thumbnail_url($id); ?>" alt="<?php echo $title; ?>" class="tji-nav-icon">
<span class="tji-nav-title"><?php echo $title; ?></span>
</a>
</div>
<?php
} //end child loop
?>
</div><!-- #tji-nav-main -->
</section>
<!-- End story navigation -->
<!-- Wrapper for our story and nav panel -->
<div class="story-wrapper">
<!-- Right side navigation panel -->
<div class="nav-panel closed">
<div class="link-container">
<div class="panel-toggle">
<a href="#">←</a>
</div>
<?php
//Loop through each story and build a panel for each
foreach ($viz_ids as $id) {
$title = get_the_title( $id );
$slug = get_post_field('post_name', $id);
?>
<div class="nav-link">
<a href="#<?php echo $slug; ?>" class="viz-link">
<div class="link-icon">
<img src="<?php echo get_the_post_thumbnail_url( $id ); ?>" alt="<?php echo $title; ?>" class="tji-nav-icon">
</div>
<div class="link-title">
<?php echo $title; ?>
</div>
</a>
</div>
<?php
} //end child loop
?>
</div><!-- .link-container -->
<!-- Social media links -->
<section id="wpcw_social-2" class="widget wpcw-widgets wpcw-widget-social homepage-social-links">
<ul>
<li class="no-label">
<a href="https://google.com/+TexasJusticeInitiative" target="_blank" title="Visit Texas Justice Initiative on Google+"><span class="fab fa-2x fa-google-plus"></span></a>
</li>
<li class="no-label">
<a href="https://www.facebook.com/TXJusticeInitiative" target="_blank" title="Visit Texas Justice Initiative on Facebook"><span class="fab fa-2x fa-facebook"></span></a>
</li>
<li class="no-label">
<a href="https://twitter.com/JusticeTexas" target="_blank" title="Visit Texas Justice Initiative on Twitter"><span class="fab fa-2x fa-twitter"></span></a>
</li>
</ul>
</section>
</div><!-- .nav-links -->
<!-- Begin story sections -->
<div class="story-sections closed">
<?php
if ($viz_query->have_posts()) : while ($viz_query->have_posts()) : $viz_query->the_post();
get_template_part( 'template-parts/content', get_post_type() );
endwhile;
endif;
?>
</div><!-- .story-content -->
<div class="tji-about-brief">
<div class="tji-about-column">
<p><strong>What is the Texas Justice Initiative?</strong></p>
<p>We are a nonprofit organization that collects, analyzes, publishes and provides oversight for criminal justice data throughout Texas. Co-founded by a researcher and a journalist, TJI is devoted to increasing transparency and accountability.</p>
</div>
<div class="tji-about-column">
<p><strong>Data in context. </strong></p>
<p>TJI is building a one-stop shop for all kinds of data related to the Texas criminal justice, starting with officer-involved shootings and custodial deaths.We aim to be a resource for all.</p>
</div>
</div><!-- .tji-about-brief -->
</div><!-- .story-wrapper -->
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>