'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 = isset($instance['category']) ? $instance['category'] : 1; $show_num = isset($instance['show_num']) ? $instance['show_num'] : 3; $show_thumb = isset($instance['show_thumb']) ? $instance['show_thumb'] : false; $show_date = isset($instance['datetime']) ? $instance['datetime'] : false; $show_excerpt = isset($instance['show_excerpt']) ? $instance['show_excerpt'] : false; 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 '