'widget-recent-posts', 'description' => __( 'Displays recent posts with featured images', 'amathambo' ), ); $control_ops = array( 'width' => 200, 'height' => 250, ); parent::__construct( false, $name = __( 'AmaThambo Recent Posts','amathambo' ), $widget_ops, $control_ops ); } /** * Back-end widget form. * * @see WP_Widget::form() * @param int $instance instance of the form. */ public function form( $instance ) { $amathambo_recent_posts = ! empty( $instance['amathambo_recent_posts'] ) ? absint( $instance['amathambo_recent_posts'] ) : 5; $amathambo_recent_posts_title = ! empty( $instance['amathambo_recent_posts_title'] ) ? esc_attr( $instance['amathambo_recent_posts_title'] ) : ''; ?>

1, 'posts_per_page' => $amathambo_recent_posts, 'post_status' => 'publish', 'order' => 'desc', ); $recent = new WP_Query( $args ); if ( $recent->have_posts() ) { while ( $recent-> have_posts() ) { $recent->the_post(); ?>
>
', esc_url( get_permalink() ) ), '' ); ?>