'small-list-widget small-list-style-1', 'description' => __( 'Retrive Small List Widgets', 'blog-corner' ), ); parent::__construct( 'blog_corner_small_list_widget', __( 'Ascendoor Small List Widget', 'blog-corner' ), $blog_corner_small_list_widget_ops ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $small_list_title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : ''; $small_list_title = apply_filters( 'widget_title', $small_list_title, $instance, $this->id_base ); $small_list_post_count = isset( $instance['number'] ) ? absint( $instance['number'] ) : 4; $small_list_post_offset = isset( $instance['offset'] ) ? absint( $instance['offset'] ) : ''; $small_list_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; echo $args['before_widget']; if ( ! empty( $small_list_title ) ) { ?>
'post', 'posts_per_page' => absint( $small_list_post_count ), 'offset' => absint( $small_list_post_offset ), 'cat' => absint( $small_list_category ), ); $query = new WP_Query( $small_list_widgets_args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>

6 ) { $instance['number'] = 6; } $instance['offset'] = (int) $new_instance['offset']; $instance['category'] = (int) $new_instance['category']; return $instance; } } }