comicpress-2.8/archive-comic.php

72 lines
2.0 KiB
PHP

<?php
/*
Template Name: Comic Archive
*/
?>
<?php get_header(); ?>
<div id="content-wrapper-top"></div>
<div id="content-wrapper">
<?php if (is_cp_theme_layout('gn,v3c')) get_sidebar('left'); ?>
<?php if (is_cp_theme_layout('gn')) { ?>
<div id="pagewrap-right">
<?php } ?>
<?php if (is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<?php get_sidebar('overblog'); ?>
<?php if (is_cp_theme_layout('3c')) get_sidebar('left'); ?>
<?php if (!is_cp_theme_layout('v3c,v')) { ?>
<div id="content" class="narrowcolumn">
<div class="column">
<?php } ?>
<div class="<?php comicpress_blogpost_class(); ?>">
<div class="post-page-head"></div>
<div class="post-page">
<?php while (have_posts()) : the_post() ?>
<div class="entry">
<h2 class="pagetitle"><?php the_title() ?></h2>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
foreach ( $years as $year ) {
if ($year != (0) ) { ?>
<h3><?php echo $year ?></h3>
<table class="month-table">
<?php $comicArchive = new WP_Query(); $comicArchive->query('showposts=10000&cat='.get_all_comic_categories_as_cat_string().'&year='.$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="Permanent Link: <?php the_title() ?>"><?php the_title() ?></a></td></tr>
<?php endwhile; ?>
</table>
<?php } } ?>
<br class="clear-margins" />
</div>
<div class="post-page-foot"></div>
</div>
</div>
</div>
<?php
if (is_cp_theme_layout('3c,v3c,gn,standard,v')) {
get_sidebar('right'); ?>
<?php } ?>
<?php if (is_cp_theme_layout('gn')) { ?>
</div>
<?php } ?>
<div class="clear"></div>
</div>
<div id="content-wrapper-bottom"></div>
<?php get_footer() ?>