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:
parent
5ff967308e
commit
8f254211e5
|
@ -2,12 +2,15 @@
|
||||||
<?php include(get_template_directory() . '/layout-head.php'); ?>
|
<?php include(get_template_directory() . '/layout-head.php'); ?>
|
||||||
|
|
||||||
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) {
|
<?php if (!$comicpress_options['disable_comic_frontpage'] && !$comicpress_options['disable_comic_blog_frontpage'] && !is_paged() ) {
|
||||||
|
if (is_archive()) echo "Thinks its an archive";
|
||||||
Protect();
|
Protect();
|
||||||
$comic_query = '&showposts=1&cat='.get_all_comic_categories_as_cat_string();
|
$comic_query = 'showposts=1&cat="'.get_all_comic_categories_as_cat_string().'"';
|
||||||
$posts = query_posts($comic_query);
|
query_posts($comic_query);
|
||||||
$wp_query->is_archive = false;
|
$wp_query->is_archive = false;
|
||||||
if (have_posts()) {
|
if (have_posts()) {
|
||||||
comicpress_display_post();
|
while (have_posts()) : the_post();
|
||||||
|
comicpress_display_post();
|
||||||
|
endwhile;
|
||||||
}
|
}
|
||||||
Restore();
|
Restore();
|
||||||
UnProtect();
|
UnProtect();
|
||||||
|
|
|
@ -7,7 +7,7 @@ Author: Philip M. Hofer (Frumph)
|
||||||
Version: 1.05
|
Version: 1.05
|
||||||
Author URI: http://frumph.net/
|
Author URI: http://frumph.net/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ComicPressComicBlogPostWidget extends WP_Widget {
|
class ComicPressComicBlogPostWidget extends WP_Widget {
|
||||||
|
|
||||||
|
@ -20,15 +20,37 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
|
||||||
|
|
||||||
function widget($args, $instance) {
|
function widget($args, $instance) {
|
||||||
global $post, $wp_query;
|
global $post, $wp_query;
|
||||||
if (!is_home() && $instance['onlyhome']) return;
|
if (!is_home() && $instance['onlyhome'] || (is_page() || is_archive() || is_search())) return;
|
||||||
if (is_page() || is_search() || is_archive()) return;
|
|
||||||
extract($args, EXTR_SKIP);
|
extract($args, EXTR_SKIP);
|
||||||
if (!empty($post->post_content)) {
|
if (is_home()) {
|
||||||
echo $before_widget;
|
Protect();
|
||||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
$comic_query = 'showposts=1&cat='.get_all_comic_categories_as_cat_string();
|
||||||
if ( !empty( $title ) ) { echo "<div class=\"comic-post-header\">".$title."</div>\r\n"; }
|
$posts = query_posts($comic_query);
|
||||||
the_content();
|
if (have_posts()) {
|
||||||
echo $after_widget;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue