-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
executable file
·57 lines (44 loc) · 1.86 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
<?php get_header(); ?>
<main id="content">
<?php if (have_posts()) :
$post = $posts[0];
$not_paged = get_query_var('paged');
$not_paged = ( empty($not_paged) ) ? true : false;
?>
<header class="inform">
<?php if (is_category()) : ?>
<h1><?php _e( 'Category', 'spokane-food-policy' ); ?> «<?php single_cat_title(''); ?>»</h1>
<?php if ( $not_paged ) echo '<div class="archive-desc">'. category_description() .'</div>'; ?>
<?php elseif( is_tag() ) : ?>
<h1><?php _e( 'Tag', 'spokane-food-policy' ); ?> «<?php single_tag_title(); ?>»</h1>
<?php if ( $not_paged ) echo '<div class="archive-desc">'. tag_description() .'</div>'; ?>
<?php elseif (is_day()) : ?>
<h1><?php _e( 'Day archives:', 'spokane-food-policy' ); ?> <?php the_time('F jS, Y'); ?></h1>
<?php elseif (is_month()) : ?>
<h1><?php _e( 'Monthly archives:', 'spokane-food-policy' ); ?> <?php the_time('F, Y'); ?></h1>
<?php elseif (is_year()) : ?>
<h1><?php _e( 'Year archives:', 'spokane-food-policy' ); ?> <?php the_time('Y'); ?></h1>
<?php elseif (is_author()) : ?>
<h1><?php _e( 'Author archives', 'spokane-food-policy' ); ?></h1>
<div class="archive-desc"><?php the_author_meta('description'); ?></div>
<?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : ?>
<h1 class="arhivetitle"><?php _e( 'Archive', 'spokane-food-policy' ); ?></h1>
<?php endif; ?>
</header>
<?php while (have_posts()) : the_post();
get_template_part( 'content' );
endwhile;
the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( '« Prev', 'spokane-food-policy'),
'next_text' => __( 'Next »', 'spokane-food-policy'),
) );
else: ?>
<div class="post">
<h1><?php _e( 'Posts not found', 'spokane-food-policy' ); ?></h1>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
</main> <!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>