forked from sbstatesman/the-statesman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
executable file
·221 lines (220 loc) · 9.56 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
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
<?php get_header(); ?>
<header class="row">
<img src="<?php bloginfo( 'template_url' ); ?>/images/logo.png" class="logo" alt="The Statesman" width="700" />
<div class="currentissue large-text">
This Week's Issue<br />
<span class="coloredtext">
<?php
$issuu = new Issuu_Latest_Issue();
if ($issuu->fetch()) {
echo $issuu->outputLink();
}
?>
</span>
</div>
</header>
<main>
<div class="hline hline-strong"></div>
<?php $args = array( 'posts_per_page' => 4, 'category__in' => array($breaking, $featured), 'category__not_in' => array($opinions, $multimedia) ); ?>
<?php $myposts = get_posts( $args ); ?>
<section class="row">
<div class="main vline-medium">
<?php if (!empty($myposts[0])) : ?>
<?php $post = $myposts[0]; ?>
<?php setup_postdata( $post ); ?>
<article class="hmedia">
<figure class="thumbnail thumbnail-lede">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p class="articletype small-text"><?php the_excluded_category(array($featured, $top_story)); ?></p>
<h1 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h1>
<p class="metatext metatext-byline small-text">By <?php the_author_posts_link(); ?> / <a href="<?php the_archive_date(); ?>"><?php the_time('F j, Y'); ?></a></p>
<p class="excerpt"><?php get_excerpt(); ?></p>
</div>
</article>
<div class="hline hline-medium"></div>
<?php endif; ?>
<?php if (!empty($myposts[2])) : ?>
<?php $post = $myposts[2]; ?>
<?php setup_postdata( $post ); ?>
<article class="main-half vline-medium">
<p class="articletype small-text"><?php the_excluded_category(array($featured, $top_story)); ?></p>
<h3 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h3>
<p class="metatext metatext-byline small-text">By <?php the_author_posts_link(); ?> / <a href="<?php the_archive_date(); ?>"><?php the_time('F j, Y'); ?></a></p>
<p class="excerpt"><?php get_excerpt(); ?></p>
</article>
<?php endif; ?>
<?php if (!empty($myposts[3])) : ?>
<?php $post = $myposts[3]; ?>
<?php setup_postdata( $post ); ?>
<article class="main-half">
<p class="articletype small-text"><?php the_excluded_category(array($featured, $top_story)); ?></p>
<h3 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h3>
<p class="metatext metatext-byline small-text">By <?php the_author_posts_link(); ?> / <a href="<?php the_archive_date(); ?>"><?php the_time('F j, Y'); ?></a></p>
<p class="excerpt"><?php get_excerpt(); ?></p>
</article>
<?php endif; ?>
</div>
<?php if (!empty($myposts[1])) : ?>
<?php $post = $myposts[1]; ?>
<?php setup_postdata( $post ); ?>
<article class="sidebar">
<div class="vmedia">
<figure class="thumbnail">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p class="articletype small-text"><?php the_excluded_category(array($featured, $top_story)); ?></p>
<h1 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h1>
<p class="metatext metatext-byline small-text">By <?php the_author_posts_link(); ?> / <a href="<?php the_archive_date(); ?>"><?php the_time('F j, Y'); ?></a></p>
<p class="excerpt"><?php get_excerpt(); ?></p>
</div>
</div>
</article>
<?php endif; ?>
</section>
<div class="hline hline-strong"></div>
<section class="row">
<?php $args = array( 'posts_per_page' => 8, 'category__not_in' => array($opinions, $multimedia, $featured) ); ?>
<?php $myposts = new WP_Query( $args ); ?>
<main class="main vline-medium">
<?php if ( $myposts->have_posts() ) : ?>
<?php while ( $myposts->have_posts() ) : ?>
<?php $myposts->the_post(); ?>
<article class="hmedia hmedia-list">
<figure class="thumbnail thumbnail-large">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p class="articletype small-text"><?php the_excluded_category(array($featured, $top_story)); ?></p>
<h2 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h2>
<p class="metatext metatext-byline small-text">By <?php the_author_posts_link(); ?> / <a href="<?php the_archive_date(); ?>"><?php the_time('F j, Y'); ?></a></p>
<p class="excerpt"><?php get_excerpt(); ?></p>
</div>
</article>
<?php endwhile; ?>
<?php endif; ?>
</main>
<sidebar class="sidebar">
<?php if ( is_active_sidebar( 'home-sidebar' ) ) : ?>
<?php dynamic_sidebar( 'home-sidebar' ); ?>
<?php endif; ?>
</sidebar>
</section>
<div class="hline hline-medium"></div>
<section class="row">
<?php $args = array( 'posts_per_page' => 3, 'cat' => $news); ?>
<?php $myposts = new WP_Query( $args ); ?>
<?php if ( $myposts->have_posts() ) : ?>
<div class="fourcolumn vspace">
<div class="vmedia">
<h6><a href="<?php echo esc_url(get_category_link($news)); ?>">News</a></h6>
<?php $myposts->the_post(); ?>
<figure class="thumbnail">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php while ( $myposts->have_posts() ) : ?>
<?php $myposts->the_post(); ?>
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php $args = array( 'posts_per_page' => 3, 'cat' => $arts_and_entertainment ); ?>
<?php $myposts = new WP_Query( $args ); ?>
<?php if ( $myposts->have_posts() ) : ?>
<div class="fourcolumn vspace">
<div class="vmedia">
<h6><a href="<?php echo esc_url(get_category_link($arts_and_entertainment)); ?>">Arts</a></h6>
<?php $myposts->the_post(); ?>
<figure class="thumbnail">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php while ( $myposts->have_posts() ) : ?>
<?php $myposts->the_post(); ?>
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php $args = array( 'posts_per_page' => 3, 'cat' => $opinions ); ?>
<?php $myposts = new WP_Query( $args ); ?>
<?php if ( $myposts->have_posts() ) : ?>
<div class="fourcolumn vspace">
<div class="vmedia">
<h6><a href="<?php echo esc_url(get_category_link($opinions)); ?>">Opinions</a></h6>
<?php $myposts->the_post(); ?>
<figure class="thumbnail">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php while ( $myposts->have_posts() ) : ?>
<?php $myposts->the_post(); ?>
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php $args = array( 'posts_per_page' => 3, 'cat' => $sports ); ?>
<?php $myposts = new WP_Query( $args ); ?>
<?php if ( $myposts->have_posts() ) : ?>
<div class="fourcolumn">
<div class="vmedia">
<h6><a href="<?php echo esc_url(get_category_link($sports)); ?>">Sports</a></h6>
<?php $myposts->the_post(); ?>
<figure class="thumbnail">
<?php if ( has_post_thumbnail()) {the_post_thumbnail('medium');} ?>
</figure>
<div class="block">
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php while ( $myposts->have_posts() ) : ?>
<?php $myposts->the_post(); ?>
<p id="post-<?php the_ID(); ?>" class="metatext metatext-dark"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p>
<?php endwhile; ?>
</div>
</div>
</div>
<?php endif; ?>
</section>
<div class="hline hline-medium"></div>
<section class="row">
<div class="threecolumn vline-medium">
<h6>Issue Archive</h6>
<a href="http://issuu.com/sbstatesman"><img src="<?php bloginfo( 'template_url' ); ?>/images/footer-logo.png" alt="The Statesman" width="268" /></a>
</div>
<div class="threecolumn vline-medium">
<h6>Podcast</h6>
<a href="<?php echo get_tag_link(get_tag_id('deadline')); ?>"><img src="<?php bloginfo( 'template_url' ); ?>/images/deadline.png" alt="Deadline" width="268" /></a>
</div>
<div class="threecolumn">
<h6>Social Media</h6>
<div class="iconbar iconbar-social">
<a href="http://facebook.com/sbstatesman"><img src="<?php bloginfo( 'template_url' ); ?>/images/facebook.png" alt="Facebook" /></a>
<a href="http://twitter.com/sbstatesman"><img src="<?php bloginfo( 'template_url' ); ?>/images/twitter.png" alt="Twitter" /></a>
<a href="http://instagram.com/sbstatesman"><img src="<?php bloginfo( 'template_url' ); ?>/images/instagram.png" alt="Instagram" /></a>
<a href="http://vimeo.com/sbstatesman"><img src="<?php bloginfo( 'template_url' ); ?>/images/vimeo.png" alt="Vimeo" /></a>
</div>
</div>
</section>
<div class="hline hline-medium"></div>
</main>
<?php get_footer(); ?>