-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
153 lines (71 loc) · 3.6 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
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
<?php
/**
* The template for displaying archive pages
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package WordPress
* @subpackage schoolsUOL
* @author Jez Thompson <[email protected]>
* @since 1.0
* @version 1.0
*/
get_header(); ?>
<section class="body-section blog-body site-module">
<div class="module-inner-wrap">
<div class="post-head post-archive">
<h4 class="post-title">
<?php
if ( is_day() ) :
printf( __( 'Date: %s', 'schoolsUOL' ), get_the_date() );
elseif ( is_month() ) :
printf( __( 'Month: %s', 'schoolsUOL' ), get_the_date( _x( 'F Y', 'F = Month, Y = Year', 'schoolsUOL' ) ) );
elseif ( is_year() ) :
printf( __( 'Year: %s', 'schoolsUOL' ), get_the_date( _x( 'Y', 'Y = Year', 'schoolsUOL' ) ) );
elseif ( is_category() ) :
printf( __( '%s', 'schoolsUOL' ), single_cat_title( '', false ) . '' );
elseif ( is_tag() ) :
printf( __( '%s', 'schoolsUOL' ), single_tag_title( '', false ) . '' );
elseif ( is_author() ) :
$curauth = ( isset( $_GET['author_name'] ) ) ? get_user_by( 'slug', $author_name ) : get_userdata( intval( $author ) );
printf( __( '%s', 'schoolsUOL' ), $curauth->display_name );
else :
_e( 'Archive', 'schoolsUOL' );
endif;
?>
</h4>
<?php $paged = get_query_var( 'paged' ) ?: 1;
if ( 1 < $wp_query->max_num_pages ) : ?>
<h3><?php printf( __( '(page %s of %s)', 'schoolsUOL' ), $paged, $wp_query->max_num_pages ); ?></h3>
<?php endif; ?>
<?php
$tag_description = tag_description();
if ( ! empty( $tag_description ) ) {
echo apply_filters( 'tag_archive_meta', '<div class="tag-meta">' . $tag_description . '</div>' );
}
?>
</div> <!--post-head-->
<?php if ( have_posts() ) : ?>
<div class="posts-wrapper columns-wrap">
<?php while ( have_posts() ) : the_post(); ?>
<?php if( get_theme_mod('schools_theme_choice') == 'visual-layout' ) : ?>
<div class="post-article-container column-spacings column column--1-of-2 column--medium-1-of-1 column--small-1-of-1">
<article id="post-article-<?php the_ID(); ?>" <?php post_class(); ?> >
<?php get_template_part( 'template-parts/content', get_post_format() ); ?>
</article>
</div> <!--post-article-container-->
<?php else : ?>
<div class="post-article-container column-spacings column column--1-of-3 column--medium-1-of-2 column--small-1-of-2">
<article id="post-article-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php get_template_part( 'template-parts/content', get_post_format() ); ?>
</article>
</div> <!--post-article-container-->
<?php endif; ?>
<?php endwhile; ?>
</div> <!--posts-wrapper-->
<?php endif; wp_reset_query(); ?>
</div> <!--posts-wrapper-->
</div> <!--module-inner-wrap-->
<?php get_template_part( 'template-parts/site/loop', 'nav' ); ?>
</section>
<?php get_footer(); ?>