-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.php
65 lines (61 loc) · 2.16 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
<?php
/**
*
* archive.php
*
* The archive template. Used when a category, author, or date is queried.
* Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.
*
* More detailed information about template’s hierarchy: http://codex.wordpress.org/Template_Hierarchy
*
*/
get_header(); ?>
<?php get_sidebar('top'); ?>
<?php
if (have_posts()) {
global $posts;
$post = $posts[0];
theme_ob_start();
if (is_category()) {
echo '<h4>' . single_cat_title('', false) . '</h4>';
echo category_description();
} elseif (is_tag()) {
echo '<h4>' . single_tag_title('', false) . '</h4>';
} elseif (is_day()) {
echo '<h4>' . sprintf(__('Daily Archives: <span>%s</span>', THEME_NS), get_the_date()) . '</h4>';
} elseif (is_month()) {
echo '<h4>' . sprintf(__('Monthly Archives: <span>%s</span>', THEME_NS), get_the_date('F Y')) . '</h4>';
} elseif (is_year()) {
echo '<h4>' . sprintf(__('Yearly Archives: <span>%s</span>', THEME_NS), get_the_date('Y')) . '</h4>';
} elseif (is_author()) {
the_post();
echo theme_get_avatar(array('id' => get_the_author_meta('user_email')));
echo '<h4>' . get_the_author() . '</h4>';
$desc = get_the_author_meta('description');
if ($desc) {
echo '<div class="author-description">' . $desc . '</div>';
}
rewind_posts();
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo '<h4>' . __('Blog Archives', THEME_NS) . '</h4>';
}
theme_post_wrapper(array('content' => theme_ob_get_clean(), 'class' => 'breadcrumbs'));
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_top_posts_navigation')) {
theme_page_navigation();
}
/* Start the Loop */
while (have_posts()) {
the_post();
get_template_part('content', get_post_format());
}
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_bottom_posts_navigation')) {
theme_page_navigation();
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<?php get_footer();