-
Notifications
You must be signed in to change notification settings - Fork 4
/
archive.php
110 lines (103 loc) · 4.8 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
get_header();
do_action('comic-blog-area');
// set to empty
$count = $theCatID = '';
if (is_category()) {
$theCatID = get_term_by( 'slug', $wp_query->query_vars['category_name'], 'category' );
if (!empty($theCatID))
$theCatID = $theCatID->term_id;
if (isset($wp_query->query_vars['cat'])) $theCatID = (int)$wp_query->query_vars['cat'];
}
$count = $wp_query->found_posts;
if (empty($count)) $count = 'No';
$title_string = '';
if ($count > 0) {
if (is_category()) { /* Category */
$title_string = __( 'Archive for', 'easel' ).' '.single_cat_title('',false);
} elseif(is_tag()) { /* Tag */
$title_string = __( 'Posts Tagged', 'easel' ).' '.single_tag_title('',false);
} elseif (is_day()) {
$title_string = __( 'Archive for', 'easel' ).' '.get_the_time('F jS, Y').' ';
} elseif (is_month()) {
$title_string = __( 'Archive for', 'easel' ).' '.get_the_time('F, Y');
} elseif (is_year()) {
$title_string = __( 'Archive for', 'easel' ).' '.get_the_time('Y');
} elseif (is_author()) {
$title_string = __( 'Author Archive', 'easel' ).' '.get_the_time('Y');
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
$title_string = __( 'Archives', 'easel' );
} elseif (isset($wp_query->query_vars['taxonomy']) && taxonomy_exists($wp_query->query_vars['taxonomy'])) {
$taxonomy_name = '';
if (isset($wp_query->query_vars['chapters'])) {
$taxonomy_name = get_term_by('slug', $wp_query->query_vars['chapters'], 'chapters');
if (!is_wp_error($taxonomy_name) && !empty($taxonomy_name)) $title_string = $taxonomy_name->name;
} elseif (isset($wp_query->query_vars['locations'])) {
$taxonomy_name = get_term_by('slug', $wp_query->query_vars['locations'], 'locations');
if (!is_wp_error($taxonomy_name) && !empty($taxonomy_name)) $title_string = $taxonomy_name->name;
} elseif (term_exists($wp_query->query_vars['term'])) {
$title_string = __( 'Archive for', 'easel' ).' '.$wp_query->query_vars['term'];
} else {
$title_string = __( 'Archive for', 'easel' ).' '.$wp_query->query_vars['taxonomy'];
}
} elseif ($wp_query->query_vars['post_type'] !== 'post') {
$title_string = __( 'Archive for', 'easel' ).' '.$wp_query->query_vars['post_type'];
} else {
$title_string = __( 'Archive is unable to be found.', 'easel' );
}
} else $title_string = __( 'No Archive Found.', 'easel' );
if (have_posts()) { ?>
<h2 class="page-title"><?php echo $title_string; ?></h2>
<?php if (isset($wp_query->query_vars['chapters']) || ($wp_query->query_vars['post_type'] == 'comic')) { ?>
<div class="archiveresults"><?php printf(_n( "%d comic.", "%d comics.", $count, 'easel' ),$count); ?></div>
<?php } else { ?>
<div class="archiveresults"><?php printf(_n( "%d result.", "%d results.", $count, 'easel' ),$count); ?></div>
<?php } ?>
<div class="clear"></div>
<?php if (function_exists('ceo_pluginfo') && (isset($wp_query->query_vars['chapters']) || isset($wp_query->query_vars['characters']) || isset($wp_query->query_vars['locations']) || ($wp_query->query_vars['post_type'] == 'comic')) && (easel_themeinfo('display_archive_as_links') && !easel_is_bbpress())) { ?>
<?php while (have_posts()) : the_post(); ?>
<div class="archivecomicthumbwrap">
<div class="archivecomicthumbdate"><?php echo get_the_time('M jS, Y'); ?></div>
<div class="archivecomicframe">
<?php
$thumbnail = ceo_display_comic_thumbnail('thumbnail', $post);
$thumbnail = (!$thumbnail) ? __( 'No Thumbnail or Featured Image Found', 'easel' ) : $thumbnail; ?>
<a href="<?php the_permalink() ?>" title="<?php echo the_title(); ?>"><?php echo $thumbnail; ?></a><br />
</div>
</div>
<?php endwhile; ?>
<?php } elseif (easel_themeinfo('display_archive_as_links') || easel_is_bbpress()) { ?>
<div <?php post_class(); ?>>
<div class="post-head"></div>
<div class="entry">
<table class="archive-table">
<?php while (have_posts()) : the_post(); ?>
<tr>
<td class="archive-date">
<span class="archive-date-month-day"><?php the_time('M d, ') ?></span>
<span class="archive-date-year"><?php the_time('Y'); ?></span>
</td>
<td class="archive-title">
<a href="<?php echo get_permalink($post->ID) ?>" rel="bookmark" title="<?php _e( 'Permanent Link:', 'easel' ); ?> <?php the_title() ?>"><?php the_title() ?></a>
</td>
</tr>
<?php endwhile; ?>
</table>
</div>
<div class="post-foot"></div>
</div>
<?php } else {
while (have_posts()) : the_post();
$post_format = ($post->post_type !== 'post') ? $post->post_type : get_post_format();
get_template_part( 'content', $post_format );
endwhile;
}
?>
<div class="clear"></div>
<?php easel_pagination(); ?>
<?php } else { ?>
<h2 class="page-title"><?php echo $title_string; ?></h2>
<div class="archiveresults"><?php printf(_n( "%d result.", "%d results.", $count, 'easel' ),$count); ?></div>
<div class="clear"></div>
<?php } ?>
<?php get_footer(); ?>