-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
170 lines (107 loc) · 3.52 KB
/
archive.php
File metadata and controls
170 lines (107 loc) · 3.52 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
170
<?php get_header(); ?>
<div id="content">
<div id="inner-content">
<?php get_sidebar(); ?>
<div id="page-header">
<h1>Archives Title</h1>
</div>
<?php get_sidebar(); ?>
<div id="main">
<div class="inner-wrap">
<?php
// loop starts
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
?>
<?php if (is_category()) { ?>
<h2 class="archive-title">
<?php
echo 'Articles under: ';
single_cat_title();
?>
</h2>
<?php } elseif (is_tag()) { ?>
<h2 class="archive-title">
<?php
echo 'Articles under: ';
single_tag_title();
?>
</h2>
<?php } elseif (is_author()) {
global $post;
$author_id = $post->post_author;
?>
<h2 class="archive-title">
<?php
echo 'Posts By: ' . get_the_author_meta('display_name', $author_id);
?>
</h2>
<?php } elseif (is_day()) { ?>
<h2 class="archive-title">
<?php
echo 'Articles in: ' . get_the_time('l, F j, Y');
?>
</h2>
<?php } elseif (is_month()) { ?>
<h2 class="archive-title">
<?php
echo 'Monthly Archives: ' . get_the_time('F Y');
?>
</h2>
<?php } elseif (is_year()) { ?>
<h1 class="archive-title">
<?php
echo 'Yearly Archives: ' . get_the_time('Y');
?>
</h1>
<?php } ?>
<article id="post-<?php the_ID(); ?>" class="post" role="article">
<header class="article-header">
<h3 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="byline">
<?php
the_time('F jS, Y');
?>
</div>
</header> <!-- end article header -->
<section class="entry-content">
<?php
if ( has_post_thumbnail() ) {
echo '<div class="featured-img">';
the_post_thumbnail('full-width');
echo '</div>';
}
the_excerpt();
?>
</section> <!-- end article section -->
<footer class="article-footer">
</footer> <!-- end article footer -->
</article> <!-- end article -->
<?php
} // end while
} // end if
else {
?>
<article id="post-not-found" class="post">
<header class="article-header">
<h1>Post not found</h1>
</header>
<section class="entry-content">
<p>Sorry, the content you requested doesn't exist or is not available at this moment.</p>
</section>
<footer class="article-footer">
</footer>
</article>
<?php
} //end else
// loop ends
?>
<div id="pagination">
<p><?php posts_nav_link(); ?></p>
</div>
</div> <!-- end #main -->
</div> <!-- end #main-wrap -->
</div> <!-- end #inner-content -->
</div> <!-- end #content -->
<?php get_footer(); ?>