From 0357068abeb8b2199d4532b56681febf015b22ed Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Thu, 24 Dec 2009 15:01:47 -0800 Subject: [PATCH] displayblogpost and displaycomicpost now disappear and it's centralized to comicpress_display_post() inside displaypost.php, adjusted post_classes to work properly with it Signed-off-by: Philip M. Hofer (Frumph) --- 404.php | 8 ++-- archive-comic-calendar.php | 2 +- archive-comic-month.php | 2 +- archive-comic-storyline-thumbs.php | 2 +- archive-comic-storyline.php | 2 +- archive-comic-year.php | 2 +- archive-comic.php | 2 +- archives.php | 2 +- functions/classes.php | 15 ++++--- functions/displayblogpost.php | 2 +- functions/displaycomicpost.php | 4 +- functions/displaypost.php | 67 +++++++++++++++++------------- index.php | 4 +- links.php | 2 +- page.php | 2 +- single.php | 8 ++-- style.css | 28 ++++++------- 17 files changed, 83 insertions(+), 71 deletions(-) diff --git a/404.php b/404.php index dae91cc..9dea826 100644 --- a/404.php +++ b/404.php @@ -1,14 +1,14 @@ -
-
-
+
+
+

-
+
diff --git a/archive-comic-calendar.php b/archive-comic-calendar.php index f60766a..552cd31 100644 --- a/archive-comic-calendar.php +++ b/archive-comic-calendar.php @@ -70,7 +70,7 @@ $month['12'] = array('month' => __('December','comicpress'), 'days' => '31'); - + diff --git a/archive-comic-month.php b/archive-comic-month.php index 13da5ea..d52ff14 100644 --- a/archive-comic-month.php +++ b/archive-comic-month.php @@ -9,7 +9,7 @@ Template Name: This Month of Comics diff --git a/archive-comic-storyline.php b/archive-comic-storyline.php index f1f0a87..fc5d4e5 100644 --- a/archive-comic-storyline.php +++ b/archive-comic-storyline.php @@ -9,7 +9,7 @@ Template Name: Comic Storyline Archive diff --git a/archive-comic-year.php b/archive-comic-year.php index bf0fa27..48041b9 100644 --- a/archive-comic-year.php +++ b/archive-comic-year.php @@ -20,7 +20,7 @@ if (empty($archive_year) || $archive_year == '') $archive_year = date('Y'); diff --git a/archive-comic.php b/archive-comic.php index c82a8a2..077d13e 100644 --- a/archive-comic.php +++ b/archive-comic.php @@ -9,7 +9,7 @@ Template Name: Comic Archive diff --git a/archives.php b/archives.php index 41bd207..2c28c63 100644 --- a/archives.php +++ b/archives.php @@ -9,7 +9,7 @@ Template Name: Archives diff --git a/functions/classes.php b/functions/classes.php index 20fc447..3fd1a40 100644 --- a/functions/classes.php +++ b/functions/classes.php @@ -91,7 +91,9 @@ function comicpress_body_class($classes = '') { return $classes; } -function comicpress_post_class($class = '') { +add_filter('post_class','comicpress_post_class'); + +function comicpress_post_class($classes = '') { global $post; static $post_alt; @@ -101,6 +103,12 @@ function comicpress_post_class($class = '') { /* Microformats. */ $classes[] = 'uentry'; + + /* if a comic category */ + if (in_comic_category()) $classes[] = 'comicpost'; + if (is_page()) $classes[] = 'pagepost'; + if (!in_comic_category() && !is_page()) $classes[] = 'blogpost'; + /* Post alt class. */ $classes[] = 'postonpage-' . ++$post_alt; @@ -129,10 +137,7 @@ function comicpress_post_class($class = '') { $classes = array_merge( $classes, $class ); endif; - /* Join all the classes into one string and echo them. */ - $class = join( ' ', $classes ); - - echo apply_filters( 'comicpress_post_class', $class ); + return $classes; } add_filter('comment_class','comicpress_comment_class'); diff --git a/functions/displayblogpost.php b/functions/displayblogpost.php index 137ba01..a5820be 100644 --- a/functions/displayblogpost.php +++ b/functions/displayblogpost.php @@ -35,7 +35,7 @@ function display_blog_post() {
- +
diff --git a/functions/displaycomicpost.php b/functions/displaycomicpost.php index 13bb8e3..6289ba8 100644 --- a/functions/displaycomicpost.php +++ b/functions/displaycomicpost.php @@ -45,8 +45,8 @@ function display_comic_post($frontpage = 0) {
-
- +
+
diff --git a/functions/displaypost.php b/functions/displaypost.php index 5d21009..3b6e29f 100644 --- a/functions/displaypost.php +++ b/functions/displaypost.php @@ -26,7 +26,7 @@ function comicpress_display_post_thumbnail() { function comicpress_display_author_gravatar() { global $post, $wp_query, $comicpress_options; - if ((!in_comic_category() && $comicpress_options['enable_post_author_gravatar']) || (in_comic_category() && $comicpress_options['enable_comic_post_author_gravatar']) && !is_page()) { + if (((!in_comic_category() && $comicpress_options['enable_post_author_gravatar']) || (in_comic_category() && $comicpress_options['enable_comic_post_author_gravatar'])) && !is_page()) { $author_get_gravatar = str_replace("alt='", "alt='".get_the_author_meta('display_name')."' title='".get_the_author_meta('display_name'),comicpress_get_avatar(get_the_author_meta('email'), 64)); $author_gravatar = "
".$author_get_gravatar."
\r\n"; echo apply_filters('comicpress_display_author_gravatar', $author_gravatar); @@ -68,7 +68,7 @@ function comicpress_display_post_tags() { } function comicpress_display_comment_link() { - global $post, $comicpress_option; + global $post; if ('open' == $post->comment_status) { if (comicpress_check_child_file('partials/commentlink') == false && !is_single()) { $post_comment_link = "
".get_comment_reply_link('  '.__('Comment ','comicpress'), '1 '.__('Comment ','comicpress'), '% '.__('Comments ','comicpress'))."
\r\n"; @@ -77,6 +77,16 @@ function comicpress_display_comment_link() { } } +function comicpress_display_related_posts() { + global $post, $comicpress_options; + if (in_comic_category() && $comicpress_options['enable_related_comics']) { + echo ComicPressRelatedPosts::display_related_comics(); + } + if (!in_comic_category() && $comicpress_options['enable_related_posts']) { + echo ComicPressRelatedPosts::display_related_posts(); + } +} + function comicpress_display_blog_navigation() { global $post, $wp_query; if (is_single() && !in_comic_category()) { ?> @@ -90,6 +100,24 @@ function comicpress_display_blog_navigation() { + +
+
> +
@@ -144,32 +174,13 @@ function comicpress_display_post() {
- +
+ ', '

'); } ?>
-
- -
-
- -
- -
-
- '
'.__('Pages:','comicpress').' ', 'after' => '
', 'next_or_number' => 'number')); ?> -
- ', '

') ?> -
-
-
- \ No newline at end of file diff --git a/index.php b/index.php index 45a5c3f..5f8e36f 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ $wp_query->is_archive = false; if (have_posts()) { while (have_posts()) : the_post(); - display_comic_post(); + comicpress_display_post(); comments_template(); endwhile; } @@ -38,7 +38,7 @@
diff --git a/links.php b/links.php index f9a72dd..17b5097 100644 --- a/links.php +++ b/links.php @@ -9,7 +9,7 @@ Template Name: Links diff --git a/page.php b/page.php index cba09bc..08d5024 100644 --- a/page.php +++ b/page.php @@ -3,7 +3,7 @@ - + diff --git a/single.php b/single.php index 46a80f6..4634906 100644 --- a/single.php +++ b/single.php @@ -5,7 +5,7 @@ if (have_posts()) : while (have_posts()) : the_post(); if (in_comic_category()) { if (!$comicpress_options['disable_comic_blog_single']) { - display_comic_post(); + comicpress_display_post(); $cur_date = mysql2date('Y-m-j', $post->post_date); $next_comic = get_next_comic(); $next_comic = (array)$next_comic; @@ -13,7 +13,7 @@ if (have_posts()) : while (have_posts()) : the_post(); $blog_query = 'showposts='.$blog_postcount.'&order=asc&cat=-'.exclude_comic_categories(); } } else { - display_blog_post(); + comicpress_display_post(); } endwhile; ?> @@ -40,7 +40,7 @@ if (have_posts()) : while (have_posts()) : the_post();
@@ -66,7 +66,7 @@ if (have_posts()) : while (have_posts()) : the_post(); add_filter('posts_where', 'filter_where'); $posts = query_posts($blog_query); if (have_posts()) { while (have_posts()) : the_post(); - display_blog_post(); + comicpress_display_post(); endwhile; } } $post = $temppost; $wp_query = $temp_query; $temppost = null; $temp_query = null; diff --git a/style.css b/style.css index 97c72be..890f953 100644 --- a/style.css +++ b/style.css @@ -474,33 +474,29 @@ h4, h4 a { padding: 1%; } -.post, .post-comic, .post-page { +.post { clear: both; text-align: left; } -.post-page-head { - padding-top: 5px; -} - -.post-foot, .post-comic-foot { +.post-foot { margin-bottom: 40px; } -.post-image, .post-comic-image, .post-page-image { +.post-image { } -.post-info, .post-comic-info { +.post-info { padding-bottom: 5px; font-size: 12px; } -.post-text, .post-comic-text { +.post-text { overflow: hidden; display: block; } -.post-author-gravatar, .post-comic-author-gravatar { +.post-author-gravatar { float: right; } @@ -509,7 +505,7 @@ h4, h4 a { margin-right: 2px; } -.post-calendar-date, .post-comic-calendar-date { +.post-calendar-date { color: #777; font-family: 'Georgia' , serif; font-size: 15px; @@ -518,7 +514,7 @@ h4, h4 a { margin-right: 3px; } -.post-calendar-date .calendar-date, .post-comic-calendar-date .calendar-date { +.post-calendar-date .calendar-date { height: 50px; width: 45px; background: url(images/calendar.png) center no-repeat; @@ -532,7 +528,7 @@ h4, h4 a { } -.post-calendar-date .calendar-date span, .post-comic-calendar-date .calendar-date span { +.post-calendar-date .calendar-date span { height: 16px; padding: 1px 0 4px 0; display: block; @@ -560,17 +556,17 @@ h4, h4 a { clear: both; } -.post-tags, .post-comic-tags { +.post-tags { font-size: 12px; } -.post .members-only, .post-comic .members-only { +.post .members-only { border: 1px dotted #000; background: #fafafa; padding: 3px; } -.post .non-member, .post-comic .non-member { +.post .non-member { border: 1px dotted #000; background: #fafafa; padding: 3px;