This repository has been archived by the owner on Feb 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
home.php
240 lines (235 loc) · 7.16 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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php
/**
* The home template file
*
* This is the home page.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package The_Stanford_Daily
*/
get_header();
function tsd_query_not_featured_posts($args) {
$args['tax_query'] = array (
array (
'taxonomy' => 'category',
'field' => 'slug',
'terms' => "featured",
'operator' => 'NOT IN'
)
);
return query_posts($args);
}
?>
<div id="primary" class="content-area">
<main id="main" class="site-main tsd-home-main container-fluid">
<div class="row">
<div class="col-12 col-lg-8">
<div class="row">
<div class="col-12 tsd-excerpt-container-bignews">
<?php
query_posts( array ( 'category_name' => 'featured', 'posts_per_page' => 1 ));
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/excerpt', get_post_type() );
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
</div>
<div class="row tsd-block">
<?php
query_posts( array ( 'category_name' => 'featured', 'posts_per_page' => 2, 'offset' => 1 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo '<div class="col-12 col-lg-6 tsd-excerpt-container-small">';
get_template_part( 'template-parts/excerpt-thumb', get_post_type() );
echo "</div>";
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("news")); ?>">
<h3 class="tsd-block-title">News</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'NEWS', 'posts_per_page' => 4 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo '<div class="col-12 col-lg-6 tsd-excerpt-container-small">';
get_template_part( 'template-parts/excerpt-thumb', get_post_type() );
echo "</div>";
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("sports")); ?>">
<h3 class="tsd-block-title">Sports</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'SPORTS', 'posts_per_page' => 6 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo '<div class="col-12 col-lg-6 tsd-excerpt-container-small">';
get_template_part( 'template-parts/excerpt-thumb', get_post_type() );
echo "</div>";
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("arts-life")); ?>">
<h3 class="tsd-block-title">Arts & Life</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'arts-life', 'posts_per_page' => 6 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo '<div class="col-12 col-lg-6 tsd-excerpt-container-small">';
get_template_part( 'template-parts/excerpt-thumb', get_post_type() );
echo "</div>";
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("sponsored")); ?>">
<h3 class="tsd-block-title">Sponsored Content</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'sponsored', 'posts_per_page' => 4 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
echo '<div class="col-12 col-lg-6 tsd-excerpt-container-small">';
get_template_part( 'template-parts/excerpt-thumb', get_post_type() );
echo '</div>';
endwhile;
else:
// Do nothing
endif;
wp_reset_query();
?>
</div>
</div>
<div class="col-12 col-lg-4">
<?php
$post = get_page_by_path('sidebar');
if ($post) {
$content = apply_filters('the_content', $post->post_content);
echo $content;
}
?>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("opinions")); ?>">
<h3 class="tsd-block-title">Opinions</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'opinions', 'posts_per_page' => 4 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/excerpt-textonly', get_post_type() );
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("thegrind")); ?>">
<h3 class="tsd-block-title">The Grind</h3>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'thegrind', 'posts_per_page' => 4 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/excerpt-textonly', get_post_type() );
endwhile;
else:
get_template_part( 'template-parts/content', 'none' );
endif;
wp_reset_query();
?>
</div>
<div class="row tsd-block-title">
<div class="col-12">
<a href="<?php echo get_category_link(get_category_by_slug("magazine")); ?>">
<h3 class="tsd-block-title">Magazine</h3>
<?php include "inc/magazine-slider-single.php"; ?>
</a>
</div>
</div>
<div class="row tsd-block">
<?php
tsd_query_not_featured_posts( array ( 'category_name' => 'magazine', 'posts_per_page' => 4 ) );
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/excerpt-textonly', get_post_type() );
endwhile;
else:
// Do nothing
endif;
wp_reset_query();
?>
</div>
</div>
</div>
<div class="row tsd-block" style="margin-top: 25px;">
<div class="col-12" style="height: 150px">
<div class="scorestream-widget-container" data-ss_widget_type="horzScoreboard" data-user-widget-id="28769"></div><script async="async" type="text/javascript" src="https://scorestream.com/apiJsCdn/widgets/embed.js"></script>
</div>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();