'extended-recent-posts widget_extended_recent_posts', 'description' => esc_html__( 'Widget to display recent posts with thumbnail and date. Receommended to use in sidebar or footer.', 'pt-magazine' ), ); parent::__construct( 'pt-magazine-extended-recent-posts', esc_html__( 'PT: Advance Recent 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']; ?>
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', 'pt-magazine' ), 'post_number' => 5, ) ); ?>