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