-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.php
76 lines (62 loc) · 2.08 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 get_header(); ?>
<main id="content">
<?php do_action( 'aperitto_main_archive_inner_begin' ); ?>
<?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', 'aperitto' ); ?> «<?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', 'aperitto' ); ?> «<?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:', 'aperitto' ); ?> <?php the_time( 'F jS, Y' ); ?></h1>
<?php elseif ( is_month() ) : ?>
<h1><?php _e( 'Monthly archives:', 'aperitto' ); ?> <?php the_time( 'F, Y' ); ?></h1>
<?php elseif ( is_year() ) : ?>
<h1><?php _e( 'Year archives:', 'aperitto' ); ?> <?php the_time( 'Y' ); ?></h1>
<?php elseif ( is_author() ) : ?>
<h1><?php _e( 'Author archives', 'aperitto' ); ?></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', 'aperitto' ); ?></h1>
<?php endif; ?>
</header>
<?php do_action( 'aperitto_main_archive_after_before_loop' ); ?>
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'content' );
endwhile;
the_posts_pagination(
apply_filters(
'aperitto_archive_posts_pagination_args',
array(
'mid_size' => 2,
'prev_text' => __( '« Prev', 'aperitto' ),
'next_text' => __( 'Next »', 'aperitto' ),
)
)
);
else :
?>
<div class="post">
<h1><?php _e( 'Posts not found', 'aperitto' ); ?></h1>
<?php get_search_form(); ?>
</div>
<?php endif; ?>
<?php do_action( 'aperitto_main_archive_inner_end' ); ?>
</main> <!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>