/
archive.php
executable file
·104 lines (102 loc) · 2.71 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/**
* The template for displaying Archive pages
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you'd like to further customize these archive views, you may create a
* new template file for each specific one. For example, multiloquent
* already has tag.php for Tag archives, category.php for Category archives,
* and author.php for Author archives.
*
* @link http://codex.wordpress.org/Template_Hierarchy
* @package multiloquent
*/
/**
* The template for displaying Archive pages
*/
get_header();
if ( have_posts() ) {
?>
<div class="jumbotron category-banner">
<div class="container-fluid clearfix">
<header>
<h1 class="article_title">
<?php
if ( is_category() ) {
printf( '%s', single_cat_title( '', false ) );
} elseif ( is_tag() ) {
printf(
esc_html__( 'Posts Tagged %s', 'multiloquent' ),
single_cat_title( '', false )
);
} elseif ( is_day() ) {
printf(
esc_html__( 'Archive for %s', 'multiloquent' ),
get_the_time( 'F jS, Y' )
);
} elseif ( is_month() ) {
printf(
esc_html__( 'Archive for %s', 'multiloquent' ), get_the_time( 'F Y' )
);
} elseif ( is_year() ) {
printf(
esc_html__( 'Archive for %s', 'multiloquent' ),
get_the_time( 'Y' )
);
} elseif ( is_search() ) {
printf(
esc_html__( 'Search Results', 'multiloquent' )
);
} elseif ( is_author() ) {
printf(
esc_html__( 'All entries by this author', 'multiloquent' )
);
} elseif ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) {
printf(
esc_html__( 'Blog Archives', 'multiloquent' )
);
} elseif ( is_home() ) {
printf(
esc_html__( 'Recent Posts', 'multiloquent' )
);
}
?>
</h1>
</header>
</div>
</div>
<section class="container-fluid post clearfix">
<?php
$colour = $multiloquent->multiloquent_get_random_blue_class();
while ( have_posts() ) {
the_post();
$multiloquent->multiloquent_render_the_archive( $colour );
}
?>
</section>
<section class="container-fluid post clearfix">
<?php
get_template_part( 'advert' );
?>
</section>
<div class="container-fluid post clearfix">
<nav class="navitems text-center">
<ul class="pagination">
<li><?php previous_posts_link( esc_html__( 'Previous Entries', 'multiloquent' ) ); ?></li>
<li><?php next_posts_link( esc_html__( 'Next Entries', 'multiloquent' ) ); ?></li>
</ul>
</nav>
</div>
<?php
} else {
?>
<div class="container-fluid post clearfix">
<?php
get_template_part( 'error-snippet' );
?>
</div>
<?php
}
get_footer();