esc_html__( 'Adds latest posts to the left or right sidebar in BlogSon WordPress theme. ', 'blogson'), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { extract( $args ); extract( wp_parse_args( $instance, $this->defaults ) ); $no_of_posts = ( ! empty( $instance['no_of_posts'] ) ) ? absint( $instance['no_of_posts'] ) : 3; $section_title = ! empty( $instance['section_title'] ) ? esc_html( $instance['section_title'] ) : ''; $category = ! empty( $instance['category'] ) ? esc_html( $instance['category'] ) : 'category'; $bytext = esc_html(get_theme_mod( 'blogson_highlighted_area_by_text', esc_html__('By','blogson'))).': '; ?>

$no_of_posts, 'post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, ) ); } else{ $query = new WP_Query( array( 'posts_per_page' => $no_of_posts, 'post_type' => 'post', 'category__in' => $category, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, ) ); } while( $query-> have_posts() ) : $query->the_post(); ?>
<?php esc_attr_e('post-image','blogson'); ?>
|

esc_html__('-- Select -- ','blogson'),'name' => esc_attr($this->get_field_name( 'category' )), 'selected' => esc_attr($category) ) ); ?>