'ascendoor-widget bright-blog-small-list-section', 'description' => __( 'Retrive Small List Widgets', 'bright-blog' ), ); parent::__construct( 'bright_blog_small_list_widget', __( 'Ascendoor Small List Widget', 'bright-blog' ), $bright_blog_small_list_posts_widget_ops ); } /** * 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 ) { if ( ! isset( $args['widget_id'] ) ) { $args['widget_id'] = $this->id; } $small_list_title = ( ! empty( $instance['title'] ) ) ? ( $instance['title'] ) : ''; $small_list_title = apply_filters( 'widget_title', $small_list_title, $instance, $this->id_base ); $small_list_offset = isset( $instance['offset'] ) ? absint( $instance['offset'] ) : ''; $small_list_category = isset( $instance['category'] ) ? absint( $instance['category'] ) : ''; echo $args['before_widget']; ?>
'post', 'posts_per_page' => absint( 6 ), 'offset' => absint( $small_list_offset ), 'cat' => absint( $small_list_category ), ); $query = new WP_Query( $small_list_widgets_args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>