put the protect back in layout-head.php and adjusted ComicBlogPostWidget.inc to get the right info.
Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
758ebe3ce8
commit
5ff967308e
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (is_home()) {
|
if (is_home()) {
|
||||||
|
|
||||||
if (!$comicpress_options['disable_comic_frontpage']) {
|
if (!$comicpress_options['disable_comic_frontpage']) {
|
||||||
|
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();
|
||||||
query_posts($comic_query);
|
query_posts($comic_query);
|
||||||
if (have_posts()) {
|
if (have_posts()) {
|
||||||
|
@ -34,6 +34,9 @@
|
||||||
$temp_single = null;
|
$temp_single = null;
|
||||||
endwhile;
|
endwhile;
|
||||||
}
|
}
|
||||||
|
Restore();
|
||||||
|
UnProtect();
|
||||||
|
wp_reset_query();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (is_single() && in_comic_category()) {
|
if (is_single() && in_comic_category()) {
|
||||||
|
|
|
@ -20,30 +20,9 @@ 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'] || (is_page() || is_archive() || is_search())) return;
|
if (!is_home() && $instance['onlyhome']) return;
|
||||||
|
if (is_page() || is_search() || is_archive()) return;
|
||||||
extract($args, EXTR_SKIP);
|
extract($args, EXTR_SKIP);
|
||||||
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)) {
|
if (!empty($post->post_content)) {
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
||||||
|
@ -52,7 +31,6 @@ class ComicPressComicBlogPostWidget extends WP_Widget {
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function update($new_instance, $old_instance) {
|
function update($new_instance, $old_instance) {
|
||||||
$instance = $old_instance;
|
$instance = $old_instance;
|
||||||
|
|
Loading…
Reference in New Issue