This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
archive.php
92 lines (75 loc) · 3.09 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
<?php get_header(); ?>
<div id="content">
<?php if ( is_home() ) : ?>
<h1 class="archive-title archive-posts-title intro-title">
<span><?php _e( 'News', THEME_TEXT_DOMAIN ); ?></span>
</h1>
<?php elseif ( is_category() ) : ?>
<h1 class="archive-title archive-category-title intro-title">
<span><?php _e( 'Posts Categorized:', THEME_TEXT_DOMAIN ); ?></span> <?php single_cat_title(); ?>
</h1>
<?php elseif ( is_search() ) : ?>
<h1 class="archive-title archive-search-title intro-title">
<span><?php _e( 'Search:', THEME_TEXT_DOMAIN ); ?></span> <?php echo get_search_query(); ?>
</h1>
<?php elseif ( is_tag() ) : ?>
<h1 class="archive-title archive-tag-title intro-title">
<span><?php _e( 'Posts Tagged:', THEME_TEXT_DOMAIN ); ?></span> <?php single_tag_title(); ?>
</h1>
<?php elseif ( is_author() ) : ?>
<?php $author_id = $post->post_author; ?>
<h1 class="archive-title archive-author-title intro-title">
<span><?php _e( 'Posts By:', THEME_TEXT_DOMAIN ); ?></span> <?php the_author_meta( 'display_name', $author_id ); ?>
</h1>
<?php elseif ( is_day() ) : ?>
<h1 class="archive-title archive-day-title intro-title">
<span><?php _e( 'Daily Archives:', THEME_TEXT_DOMAIN ); ?></span>
<?php the_time( 'F' ); ?> <?php the_time( 'j' ); ?>, <?php the_time( 'Y' ); ?>
</h1>
<?php elseif ( is_month() ) : ?>
<h1 class="archive-title archive-month-title intro-title">
<span><?php _e( 'Monthly Archives:', THEME_TEXT_DOMAIN ); ?></span> <?php the_time( 'F Y' ); ?>
</h1>
<?php elseif ( is_year() ) : ?>
<h1 class="archive-title archive-year-title intro-title">
<span><?php _e( 'Yearly Archives:', THEME_TEXT_DOMAIN ); ?></span> <?php the_time( 'Y' ); ?>
</h1>
<?php endif; ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="<?php echo get_post_type(); ?>-<?php the_ID(); ?>" <?php post_class(); ?> role="article">
<div class="entry-header">
<?php if ( has_post_thumbnail() ) : ?>
<div class="featured-image">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<?php
// Check if post type returned supports page hierarchy and menu order. If so, don't show post meta
if ( ! post_type_supports( $post->post_type, 'page-attributes' ) ) :
?>
<p class="entry-byline vcard">
<?php
$categories = ( is_single() ) ? ' <span class="amp">&</span> filed under %4$s' : '';
printf(
__( 'Posted <time class="updated" datetime="%1$s" pubdate>%2$s</time> by <span class="author">%3$s</span>' . $categories . '.', THEME_TEXT_DOMAIN ),
get_the_time( 'Y-m-j' ),
get_the_time( get_option( 'date_format' ) ),
get_the_author_link(),
get_the_category_list( ', ' )
);
?>
</p>
<?php endif ?>
</div>
<div class="entry-content clearfix" itemprop="articleBody">
<?php echo Theme::get_excerpt( get_the_ID() ); ?>
</div>
</article>
<?php endwhile; ?>
<?php posts_nav_link(); ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>