__( 'Custom widget for recent posts with image and description', 'artfolio' ), ) ); } // Open code for widget public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', $instance['title'] ); $number = apply_filters( 'widget_number', absint( $instance['number'] )); echo $args['before_widget']; if ( !empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } $art_recent_posts = new WP_Query(); $art_recent_posts->query('showposts='.$number); while ( $art_recent_posts->have_posts() ) { $art_recent_posts->the_post(); ?>