-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate-archives.php
More file actions
169 lines (100 loc) · 4.94 KB
/
template-archives.php
File metadata and controls
169 lines (100 loc) · 4.94 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/*
Template Name: Archive template
*/
?>
<?php get_header(); ?>
<div class="wrapper">
<div class="wrapper-inner section-inner thin">
<div class="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post">
<?php if ( has_post_thumbnail() ) : ?>
<div class="featured-media">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_post_thumbnail('post-image'); ?>
<?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
<div class="media-caption-container">
<p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
</div>
<?php endif; ?>
</a>
</div> <!-- /featured-media -->
<?php endif; ?>
<div class="post-inner">
<div class="post-header">
<h2 class="post-title"><?php the_title(); ?></h2>
</div> <!-- /post-header -->
<div class="post-content">
<?php the_content(); ?>
<div class="clear"></div>
<?php edit_post_link(__('Edit','garfunkel') . ' →'); ?>
<div class="archive-box">
<div class="archive-col">
<h3><?php _e('All Posts', 'garfunkel') ?></h3>
<ul class="all-posts">
<?php $archive = get_posts('numberposts=-1');
foreach($archive as $post) : ?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title();?>
<span>(<?php the_time(get_option('date_format')); ?>)</span>
</a>
</li>
<?php endforeach; ?>
</ul>
<h3><?php _e('Archives by Categories', 'garfunkel') ?></h3>
<ul>
<?php wp_list_categories( 'title_li=', 'garfunkel' ); ?>
</ul>
<h3><?php _e('Archives by Tags', 'garfunkel') ?></h3>
<ul>
<?php $tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<li><a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s", 'garfunkel' ), $tag->name ) . '" ' . '>' . $tag->name.'</a></li> ';
}
}
wp_reset_query();?>
</ul>
</div> <!-- /archive-col -->
<div class="archive-col">
<h3><?php _e('Contributors', 'garfunkel') ?></h3>
<ul>
<?php wp_list_authors(); ?>
</ul>
<h3><?php _e('Archives by Year', 'garfunkel') ?></h3>
<ul>
<?php wp_get_archives('type=yearly'); ?>
</ul>
<h3><?php _e('Archives by Month', 'garfunkel') ?></h3>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
<h3><?php _e('Archives by Day', 'garfunkel') ?></h3>
<ul>
<?php wp_get_archives('type=daily'); ?>
</ul>
</div> <!-- /archive-col -->
<div class="clear"></div>
</div> <!-- /archive-box -->
</div> <!-- /post-content -->
<div class="clear"></div>
</div> <!-- /post-inner -->
<?php if ( comments_open() ) : ?>
<div class="comments-page-container">
<div class="comments-page-container-inner">
<?php comments_template( '', true ); ?>
</div> <!-- /comments-page-container-inner -->
</div> <!-- /comments-page-container -->
<?php endif; ?>
<?php get_sidebar(); ?>
</div> <!-- /post -->
<?php endwhile; else: ?>
<p><?php _e("We couldn't find any posts that matched your query. Please try again.", "garfunkel"); ?></p>
<?php endif; ?>
<div class="clear"></div>
</div> <!-- /content -->
</div> <!-- /section-inner -->
</div> <!-- /wrapper -->
<?php get_footer(); ?>