'amandalite_latest_posts_widget', 'description' => esc_html__('A widget that displays your latest posts from all categories or a certain', 'amandalite') ); parent::__construct( 'amandalite_latest_posts_widget', esc_html__('AmandaLite: Latest Posts', 'amandalite'), $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : esc_html__('Latest Posts', 'amandalite') ); $categories = isset($instance['categories']) ? $instance['categories'] : null; $number = isset($instance['number']) ? $instance['number'] : 4; $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories); $loop = new WP_Query($query); if ( $loop->have_posts() ) : echo wp_kses_post( $before_widget ); if ( $title ) { echo wp_kses_post( $before_title . $title . $after_title ); } ?>
have_posts() ) : $loop->the_post(); $i++; ?>
>
<?php the_title_attribute() ?>

esc_html__('Latest Posts', 'amandalite'), 'number' => 3, 'categories' => ''); $instance = wp_parse_args( (array) $instance, $defaults ); ?>