'extended-recent-posts', 'description' => esc_html__( 'Displays your recent posts with thumbnail and date. Recommended use: in sidebar or footer', 'head-blog' ), ); parent::__construct( 'head-blog-extended-recent-posts', esc_html__( 'Head Blog: Recent 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' ]; ?>
absint( $post_number ), 'no_found_rows' => true, 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => true, 'post_status' => 'publish', ); $recent_posts = new WP_Query( $recent_args ); if ( $recent_posts->have_posts() ) : while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); ?>
esc_html__( 'Recent posts', 'head-blog' ), 'post_number' => 4, ) ); ?>