'widget-recent-posts', 'description' => esc_html__( 'Displays the most recent blog posts, optionally filtered by category.', 'bradbury' ) ) ); } public function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters( 'widget_title', empty($instance['widget_title']) ? '' : $instance['widget_title'], $instance ); $category = absint($instance['category']); $show_num = absint($instance['show_num']); $show_thumb = $instance['show_thumb']; $show_date = $instance['datetime']; $show_excerpt = $instance['show_excerpt']; if ( !isset($show_num) && ( $show_num != 2 && $show_num != 3 && $show_num != 4 ) ) { $show_num = 3; } if ( isset($category) ) { $categoryLink = get_category_link($category); } if ( $args['id'] == 'homepage-content-widgets' ) { $thumb_name = 'thumb-featured-page'; $thumb_width = 530; $thumb_height = 350; } else { $thumb_name = 'post-thumbnail'; $thumb_width = 190; $thumb_height = 130; } /* Before widget (defined by themes). */ echo $before_widget; if ( $args['id'] == 'homepage-content-widgets' ) { if ( isset($category) && $category != 0 ) { ?> '; echo '