2009-11-13 16:00:25 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
Template Name: Comic Year Archive
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<?php get_header(); ?>
|
|
|
|
<?php remove_filter('pre_get_posts','comicpress_members_filter'); ?>
|
|
|
|
<?php include(get_template_directory() . '/layout-head.php'); ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if (isset($_REQUEST['archive_year'])) {
|
|
|
|
$archive_year = $_REQUEST['archive_year'];
|
|
|
|
} else {
|
|
|
|
$latest_comic = get_terminal_post_in_category(get_all_comic_categories_as_cat_string(),true);
|
|
|
|
$archive_year = get_post_time('Y', false, $latest_comic, true);
|
|
|
|
}
|
|
|
|
if (empty($archive_year) || $archive_year == '') $archive_year = date('Y');
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="<?php comicpress_post_class(); ?>">
|
|
|
|
<div class="post-page-head"></div>
|
|
|
|
<div class="post-page">
|
|
|
|
<?php while (have_posts()) : the_post() ?>
|
2009-11-18 23:15:24 +00:00
|
|
|
<?php if (function_exists('the_post_image')) {
|
|
|
|
if ( has_post_image() ) { ?>
|
|
|
|
<div class="post-page-image">
|
|
|
|
<?php the_post_image('full'); ?>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
<?php } ?>
|
2009-11-22 18:06:19 +00:00
|
|
|
<?php if (!$comicpress_options['disable_page_titles']) { ?>
|
2009-11-13 16:00:25 +00:00
|
|
|
<h2 class="pagetitle"><?php the_title() ?> <span class="page-archive-year"> <?php echo $archive_year; ?></span></h2>
|
2009-11-18 23:15:24 +00:00
|
|
|
<?php } ?>
|
|
|
|
<div class="entry">
|
2009-11-13 16:00:25 +00:00
|
|
|
<?php the_content(); ?>
|
|
|
|
</div>
|
|
|
|
<?php endwhile; ?>
|
|
|
|
<div class="archive-yearlist">|
|
|
|
|
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date ASC");
|
|
|
|
foreach ( $years as $year ) {
|
|
|
|
if ($year != (0) ) { ?>
|
|
|
|
<a href="<?php echo add_query_arg('archive_year', $year) ?>"><strong><?php echo $year ?></strong></a> |
|
|
|
|
<?php } } ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table class="month-table">
|
|
|
|
<?php $comicArchive = new WP_Query(); $comicArchive->query('&showposts=-1&cat='.get_all_comic_categories_as_cat_string().'&year='.$archive_year);
|
|
|
|
while ($comicArchive->have_posts()) : $comicArchive->the_post() ?>
|
|
|
|
<tr><td class="archive-date"><?php the_time('M j') ?></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>
|
|
|
|
|
|
|
|
<br class="clear-margins" />
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="post-page-foot"></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php include(get_template_directory() . '/layout-foot.php'); ?>
|
|
|
|
<?php get_footer() ?>
|