forked from felixdorner/kouki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
76 lines (51 loc) · 1.26 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
<?php
/**
* The template to display posts in archives.
*
* @package kouki
*/
get_header(); ?>
<?php
/**
* Here we check which title to display.
*/
global $post;
if( is_archive() && have_posts() ) : ?>
<h1 class="pad-2-1 aligncenter">
<?php
if( is_category() ) :
single_cat_title();
elseif( is_tag() ) :
printf( __( '#%s', 'kouki' ), single_tag_title( '', false ) );
elseif( is_day() ) :
the_time('M j, Y');
elseif( is_month() ) :
the_time( 'F Y' );
elseif( is_year() ) :
the_time( 'Y' );
elseif( is_author() ) :
$current_author = $wp_query->get_queried_object();
_e( 'Author: ', 'kouki' ); echo $current_author->display_name;
elseif( isset( $_GET['paged'] ) && !empty( $_GET['paged'] ) ) :
_e( 'Archive', 'kouki' );
else :
the_title();
endif; ?>
</h1>
<?php endif; ?>
<main role="main">
<?php if ( have_posts() ) : ?>
<div id="content" class="js-masonry">
<?php while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'masonry' );
endwhile; ?>
</div>
<?php kouki_paging_nav();
else :
/**
* If no posts, include the "No posts found" template.
*/
get_template_part( 'template-parts/content', 'none' );
endif; ?>
</main>
<?php get_footer(); ?>