'featured-posts', 'description' => esc_html__( 'Add Widget to Display Latest Post.', 'hasium' ) ); parent::__construct( 'hasium_latest_post',esc_html__( 'HS: Latest Post', 'hasium' ), $widget_ops, $control_ops ); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'category' => '', ) ); $category = isset( $instance['category'] ) ? absint( $instance['category'] ) : 0; ?>

'', 'class' => 'widefat', 'show_option_all' => esc_html__('From Recent Post','hasium'), 'name' => esc_attr($this->get_field_name( 'category' )), 'selected' => absint( $category ), ) ); ?>

4, 'post_type' => 'post', 'post_status' => 'publish', 'post__not_in' => get_option( 'sticky_posts' ), ); if ( absint( $category ) > 0 ) { $slider_args['cat'] = absint( $category ); } $the_query = new WP_Query( $slider_args ); if ($the_query->have_posts()) : $count= 0; ?>

have_posts() ) : $the_query->the_post(); ?>
0 ) {echo get_cat_name($category); } ?>