Index.php fix for not showing the proper blog posts in the right places.

reverting ComicBlogPostWidget.inc

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
Philip M. Hofer (Frumph) 2010-01-23 04:02:49 -08:00
parent 5ff967308e
commit 8f254211e5
2 changed files with 37 additions and 12 deletions

View File

@ -2,12 +2,15 @@
<?php include(get_template_directory() . '/layout-head.php'); ?>
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) {
if (is_archive()) echo "Thinks its an archive";
Protect();
$comic_query = '&showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query);
$comic_query = 'showposts=1&cat="'.get_all_comic_categories_as_cat_string().'"';
query_posts($comic_query);
$wp_query->is_archive = false;
if (have_posts()) {
comicpress_display_post();
while (have_posts()) : the_post();
comicpress_display_post();
endwhile;
}
Restore();
UnProtect();

View File

@ -7,7 +7,7 @@ Author: Philip M. Hofer (Frumph)
Version: 1.05
Author URI: http://frumph.net/
*/
*/
class ComicPressComicBlogPostWidget extends WP_Widget {
@ -20,15 +20,37 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
function widget($args, $instance) {
global $post, $wp_query;
if (!is_home() && $instance['onlyhome']) return;
if (is_page() || is_search() || is_archive()) return;
if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return;
extract($args, EXTR_SKIP);
if (!empty($post->post_content)) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
the_content();
echo $after_widget;
if (is_home()) {
Protect();
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
$posts = query_posts($comic_query);
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;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
the_content();
$wp_query->is_single = $temp_query;
echo $after_widget;
}
endwhile;
}
Restore();
UnProtect();
wp_reset_query();
} else {
if (!empty($post->post_content)) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
the_content();
echo $after_widget;
}
}
}