This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
80 lines (69 loc) · 3.03 KB
/
archive.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
<?php
$topArticle = new WP_Query([
'cat' => $wp_query->query_vars['cat'],
'tag' => $wp_query->query_vars['tag'],
'post_type' => ['post'],
'post_status' => ['publish'],
'posts_per_page' => 1,
'nopaging' => false
]);
if( get_query_var('paged') === 0 && get_post_type() !== 'column' ) {
$articleStream = new WP_Query([
'offset' => 1,
'cat' => $wp_query->query_vars['cat'],
'tag' => $wp_query->query_vars['tag'],
'posts_per_page' => 9
]);
} else {
$articleStream = $wp_query;
}
?>
<?php get_header(); ?>
<main id="archive">
<?php if( get_query_var('paged') === 0 && get_post_type() !== 'column' ) { ?>
<section class="top-article">
<div class="archive-info">
<div>
<h2 class="archive-title"><?php echo $wp_query->queried_object->name; ?></h2>
<p class="archive-description"><?php echo strip_tags( get_the_archive_description() ); ?></p>
</div>
<a href="https://berkeleyhighjacket.com/newsletter" class="subscribe-button" target="_blank">Get email updates</a>
</div>
<div class="top-article-inner">
<?php while( $topArticle->have_posts() ) { $topArticle->the_post(); ?>
<a href="<?php echo get_permalink(); ?>" class="grid four-three double-gap">
<?php the_post_thumbnail('three-two'); ?>
<div class="grid article-info">
<span class="article-category"><?php echo getSection(); ?></span>
<h2 class="article-title"><?php echo get_the_title(); ?></h2>
<p class="article-excerpt">
<span class="article-date"><?php echo get_the_date('F j, Y'); ?></span>
<?php echo getExcerpt(); ?>
</p>
</div>
</a>
<?php } ?>
</div>
</section>
<?php } ?>
<div class="article-stream">
<?php while( $articleStream->have_posts() ) { $articleStream->the_post(); ?>
<a class="stream-item" data-type="<?php echo get_post_type(); ?>" href="<?php echo get_permalink(); ?>">
<div class="article-info">
<span class="article-section"><?php echo getSection(); ?></span>
<h2 class="article-title"><?php echo get_the_title(); ?></h2>
<p class="article-excerpt">
<span class="article-date"><?php echo get_the_date(); ?></span>
<?php echo getExcerpt(); ?>
</p>
</div>
<?php get_post_type() == 'column' ? theColumnImage() : the_post_thumbnail('small-three-two'); ?>
</a>
<?php } ?>
<div class="navigation">
<div class="previous-page"><?php previous_posts_link( '« Previous Page' ); ?></div>
<div class="next-page"><?php next_posts_link( 'Next Page »', '' ); ?></div>
</div>
</div>
</main>
<?php get_footer(); ?>