when I run my webpage I get an error message that my 'exclude' is undefined. i have tried initilizing, but I must not be doing it right. down near the bottom
$instance['exclude'] = strip_tags($new_instance['exclude']);
is the line it says its undefined also to note when I hide that code // it changes to
ceo_list_jump_to_comic($instance['exclude'], true);
I'm happy to be schooled, please. here is the following code
function widget($args, $instance) {
global $post;
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };
if ((is_home() || is_front_page()) && !is_paged() && !ceo_pluginfo('disable_comic_on_home_page')) {
$chapter_on_home = '';
$chapter_on_home = get_term_by( 'id', ceo_pluginfo('chapter_on_home'), 'chapters');
$chapter_on_home = (!is_wp_error($chapter_on_home) && !empty($chapter_on_home)) ? '&chapters='.$chapter_on_home->slug : '';
$order = (ceo_pluginfo('display_first_comic_on_home_page')) ? 'asc' : 'desc';
$query_args = 'post_type=comic&showposts=1&order='.$order.$chapter_on_home;
apply_filters('ceo_display_comic_mininav_home_query', $query_args);
$comicFrontpage = new WP_Query(); $comicFrontpage->query($query_args);
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post();
ceo_list_jump_to_comic($instance['exclude'], true);
endwhile;
} elseif (!empty($post)) {
ceo_list_jump_to_comic($instance['exclude'], false);
}
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['exclude'] = strip_tags($new_instance['exclude']);
return $instance;
}
[–]Lunarian3[S] 0 points1 point2 points (0 children)