'popular-posts widget_popular_posts', 'description' => esc_html__( 'Displays your popular posts with thumbnail and date. Recommended use: in sidebar or footer', 'head-blog' ), ); parent::__construct( 'head-blog-popular-posts', esc_html__( 'Head Blog: Popular posts', 'head-blog' ), $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' ] : 4; echo $args[ 'before_widget' ]; ?> esc_html__( 'Popular posts', 'head-blog' ), 'post_number' => 5, ) ); ?>