diff --git a/functions/displaycomic.php b/functions/displaycomic.php index 50e5d73..68e0ddf 100644 --- a/functions/displaycomic.php +++ b/functions/displaycomic.php @@ -1,13 +1,36 @@ ID) ) { + $comic_image = get_the_post_thumbnail($post->ID,'full'); + } + } + } + if (!isset($comic_image)) { + $searchorder = explode(',',$searchorder); + $requested_archive_image = ''; + foreach ($searchorder as $type) { + if (($requested_archive_image = get_comic_url($type, $post)) !== false) { + $comic_image = "\"".get_the_title()."\""; + break; + } + } + } + return apply_filters('comicpress_display_comic_image',$comic_image); +} + + +function comicpress_display_comic_area() { global $post, $wp_query, $comicpress_options; if (comicpress_check_child_file('partials/displaycomic') == false) { ?>
-
+
@@ -15,7 +38,7 @@ function display_comic_area() { is_single = true; - display_comic_area(); + comicpress_display_comic_area(); endwhile; } Restore(); @@ -35,7 +35,7 @@ wp_reset_query(); } if (is_single() & in_comic_category()) { - display_comic_area(); + comicpress_display_comic_area(); } ?> diff --git a/widgets/LatestThumbnailWidget.inc b/widgets/LatestThumbnailWidget.inc index 77aee92..4b5ead3 100644 --- a/widgets/LatestThumbnailWidget.inc +++ b/widgets/LatestThumbnailWidget.inc @@ -32,26 +32,10 @@ class ComicPressLatestThumbnailWidget extends WP_Widget { $archive_image = null; if (have_posts()) { while (have_posts()) : the_post(); - if (!empty($post->post_content)) { - echo $before_widget; - $temp_query = $wp_query->is_single; - $wp_query->is_single = true; - foreach (array("archive", "rss", "mini", "comic") as $type) { - if (($requested_archive_image = get_comic_url($type, $post)) !== false) { - $archive_image = "\"".get_the_title()."\""; - break; - } - } - if (function_exists('has_post_thumbnail')) { - if ( has_post_thumbnail($post->ID) ) { - $archive_image = get_the_post_thumbnail($post->ID,'full'); - } - } ?> - - is_single = $temp_query; - echo $after_widget; - } + $temp_query = $wp_query->is_single; + $wp_query->is_single = true; + echo "".comicpress_display_comic_image('rss,archive,mini,comic',true)."\r\n"; + $wp_query->is_single = $temp_query; endwhile; } Restore();