forked from Frumph/comicpress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.php
More file actions
89 lines (83 loc) · 4 KB
/
Copy patharchive.php
File metadata and controls
89 lines (83 loc) · 4 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
<?php
get_header();
// 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 ','comicpress').single_cat_title('',false);
} elseif(is_tag()) { /* Tag */
$title_string = __('Posts Tagged ','comicpress').single_tag_title('',false);
} elseif (is_day()) {
$title_string = __('Archive for ','comicpress').get_the_time('F jS, Y');
} elseif (is_month()) {
$title_string = __('Archive for ','comicpress').get_the_time('F, Y');
} elseif (is_year()) {
$title_string = __('Archive for ','comicpress').get_the_time('Y');
} elseif (is_author()) {
$title_string = __('Author Archive ','comicpress').get_the_time('Y');
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
$title_string = __('Archives','comicpress');
} elseif (isset($wp_query->query_vars['taxonomy']) && taxonomy_exists($wp_query->query_vars['taxonomy'])) {
if (term_exists($wp_query->query_vars['term'])) {
$title_string = __('Archive for ','comicpress').$wp_query->query_vars['term'];
} else {
$title_string = __('Archive for ','comicpress').$wp_query->query_vars['taxonomy'];
}
} elseif ($wp_query->query_vars['post_type'] !== 'post') {
$title_string = __('Archive for ','comicpress').$wp_query->query_vars['post_type'];
} else {
$title_string = __('Archive is unable to be found.','comicpress');
}
} else $title_string = __('No Archive Found.','comicpress');
if (have_posts()) { ?>
<h2 class="page-title"><?php echo $title_string; ?></h2>
<div class="archiveresults"><?php printf(_n("%d result.", "%d results.", $count,'comicpress'),$count); ?></div>
<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')) && (comicpress_themeinfo('display_archive_as_links') && !comicpress_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','comicpress') : $thumbnail; ?>
<a href="<?php the_permalink() ?>" title="<?php echo the_title(); ?>"><?php echo $thumbnail; ?></a><br />
</div>
</div>
<?php endwhile; ?>
<?php } elseif (comicpress_themeinfo('display_archive_as_links') || comicpress_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:','comicpress'); ?> <?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 comicpress_pagination(); ?>
<?php } else { ?>
<h2 class="page-title"><?php echo $title_string; ?></h2>
<div class="archiveresults"><?php printf(_n("%d result.", "%d results.", $count,'comicpress'),$count); ?></div>
<div class="clear"></div>
<?php } ?>
<?php get_footer(); ?>