'recent_widget', 'description' => esc_html__( 'Compatible Area: Homepage', 'chives' ), ); parent::__construct( 'chives_recent_widget', esc_html__( 'ST: Recent Widget', 'chives' ), $st_widget_recent ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { // outputs the content of the widget if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $title = ( ! empty( $instance['title'] ) ) ? ( $instance['title'] ) : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $query_args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'ignore_sticky_posts' => true, ); $query = new WP_Query( $query_args ); echo $args['before_widget']; ?>