'widget_recent_entries_custom', 'description' => __( 'Recent posts with thumbnails', 'aari' ), 'customize_selective_refresh' => true, ); parent::__construct( 'Aari_Recentpost_Widget', __( 'Aari Latest Posts', 'aari' ), $widget_ops ); } private $widget_fields = array( array( 'id' => 'numberofpoststo_number', 'default' => '5', 'type' => 'number', ), array( 'id' => 'displaypostdate_checkbox', 'type' => 'checkbox', ), ); public function widget( $args, $instance ) { echo wp_kses_post( $args['before_widget'] ); if ( ! empty( $instance['title'] ) ) { echo wp_kses_post( $args['before_title'] . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $args['after_title'] ); } $aari_the_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => $instance['numberofpoststo_number'], 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'post__not_in' => get_option( 'sticky_posts' ), ) ); echo '