'popular-posts widget_popular_posts', 'description' => esc_html__( 'Widget to display popular posts with thumbnail and date. Receommended to use in sidebar or footer.', 'pt-magazine' ), ); parent::__construct( 'pt-magazine-popular-posts', esc_html__( 'PT: Popular Posts', 'pt-magazine' ), $opts ); } function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $post_number = ! empty( $instance['post_number'] ) ? $instance['post_number'] : 6; echo $args['before_widget']; ?>