more page cleanup

This commit is contained in:
John Bintz 2009-07-13 19:06:32 -04:00
parent dc62559476
commit a5ebb8f000
12 changed files with 105 additions and 84 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*~
.directory

View File

@ -77,7 +77,7 @@ class ComicPressAddonCore extends ComicPressAddon {
'none' => __('Not a comic', 'comicpress'),
'comic' => __('Comic', 'comicpress'),
'rss' => __('RSS', 'comicpress'),
'archive' => __('Archive', 'comicpress'),
'archive' => __('Archive', 'comicpress')
);
$current_type = get_post_meta($post->ID, 'comic_image_type', true);

View File

@ -4,12 +4,12 @@ Template Name: Comic Calendar Archive
*/
global $comicpress;
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
?>
<?php get_header() ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . '/style/archive-comic-calendar.css' ?>" type="text/css" />
<?php
$dayWidth = 22; //set to .cpcal-day total width in pixels including: width, left & right border, left & right margin, left & right padding

View File

@ -2,56 +2,49 @@
/*
Template Name: Comic Archive
*/
global $comicpress;
$comicpress->additional_stylesheets[] = '/style/archive-comic-calendar.css';
get_header();
?>
<?php get_header() ?>
<style>
.archive-date {
padding: 0 5px 0 0;
font-size: 11px;
white-space: nowrap;
}
.archive-title {
padding: 2px 5px;
line-height: 11px;
border-left: 1px solid #000;
}
.month-table{
border-collapse: collapse;
margin: 0 0 20px 0;
}
</style>
<div id="content" class="narrowcolumn">
<div class="post-page-head"></div>
<div class="post-page">
<h2 class="pagetitle"><?php the_title() ?></h2>
<div class="entry">
<?php while (have_posts()) : the_post(); the_content(); endwhile; ?>
<?php while (have_posts()) { the_post(); the_content(); } ?>
</div>
<?php $years = $wpdb->get_col("SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = 'publish' ORDER BY post_date DESC");
<?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) ) { ?>
if (!empty($year)) { ?>
<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; ?>
<?php
$comic_archive = new WP_Query();
$comic_archive->query('showposts=10000&cat=' . $comicpress->get_all_comic_categories_as_cat_string() . '&year='.$year);
while ($comic_archive->have_posts()) {
$comic_archive->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 }
?>
</table>
<?php } } ?>
<?php }
}
?>
<br class="clear-margins" />
</div>
<div class="post-page-foot"></div>
</div>
<?php include(TEMPLATEPATH . '/sidebar.php') ?>
<?php include(get_template_directory() . '/sidebar.php') ?>
<?php get_footer() ?>

View File

@ -15,13 +15,9 @@
} else {
include(dirname(__FILE__) . '/partials/archive-blog-post.inc');
}
} ?>
}
<div class="pagenav">
<div class="pagenav-right"><?php next_posts_link('Next Page &rsaquo;') ?></div>
<div class="pagenav-left"><?php previous_posts_link('&lsaquo; Previous Page') ?></div>
<div class="clear"></div>
</div>
include(dirname(__FILE__) . '/partials/archive-page-nav.inc');
<?php } else { ?>

View File

@ -9,6 +9,7 @@ class ComicPress {
'category_order' => false,
'blogpost_count' => 10
);
var $additional_stylesheets = array();
var $comic_post_attachments_cache = array();
@ -33,6 +34,14 @@ class ComicPress {
$this->flatten_categories();
$this->separate_categories();
$this->sort_comic_categories();
add_action('wp_head', array(&$this, 'wp_head'));
}
function wp_head() {
foreach ($this->additional_stylesheets as $uri) { ?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri() . $uri ?>" type="text/css" />
<?php }
}
/**

View File

@ -14,7 +14,6 @@
<?php } ?>
<div id="content" class="narrowcolumn">
<?php if (!is_paged()) { include(dirname(__FILE__) . '/partials/index-comic-post.inc'); } ?>
<div id="blogheader"><!-- This area can be used for a heading above your main page blog posts --></div>
@ -34,13 +33,9 @@
$wp_query->the_post();
include(dirname(__FILE__) . '/partials/index-blog-post.inc');
}
?>
<div class="pagenav">
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries &uarr;', 'comicpress')) ?></div>
<div class="pagenav-left"><?php next_posts_link(__('&darr; Previous Entries', 'comicpress')) ?></div>
<div class="clear"></div>
</div>
include(dirname(__FILE__) . '/partials/index-blog-post.inc');
?>
</div>
<?php include(dirname(__FILE__) . '/sidebar.php') ?>

View File

@ -0,0 +1,5 @@
<div class="pagenav">
<div class="pagenav-right"><?php next_posts_link('Next Page &rsaquo;') ?></div>
<div class="pagenav-left"><?php previous_posts_link('&lsaquo; Previous Page') ?></div>
<div class="clear"></div>
</div>

View File

@ -0,0 +1,5 @@
<div class="pagenav">
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries &uarr;', 'comicpress')) ?></div>
<div class="pagenav-left"><?php next_posts_link(__('&darr; Previous Entries', 'comicpress')) ?></div>
<div class="clear"></div>
</div>

View File

@ -0,0 +1,6 @@
<div class="post-head"></div>
<div class="post">
<p>Sorry, no posts matched your criteria.</p>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>

View File

@ -28,14 +28,9 @@
comments_template();
}
} else { ?>
<div class="post-head"></div>
<div class="post">
<p>Sorry, no posts matched your criteria.</p>
<br class="clear-margins" />
</div>
<div class="post-foot"></div>
<?php }
} else {
include(dirname(__FILE_) . '/partials/single-no-matches.inc');
}
?>
</div>

16
style/archive-comic.css Normal file
View File

@ -0,0 +1,16 @@
.archive-date {
padding: 0 5px 0 0;
font-size: 11px;
white-space: nowrap;
}
.archive-title {
padding: 2px 5px;
line-height: 11px;
border-left: 1px solid #000;
}
.month-table {
border-collapse: collapse;
margin: 0 0 20px 0;
}