esc_html__( 'Displays posts. Place it in "Front Page Widget Area Top" widget area.', 'newspaper-magazine' ) ); parent::__construct( 'news-layout-widget-five', esc_html__( 'News Widget Five', 'newspaper-magazine' ), $opts ); } function widget( $args, $instance ){ $icon_1 = ! empty( $instance[ 'icon_1' ] ) ? $instance[ 'icon_1' ] : ''; $title_1 = apply_filters( 'widget_title', ! empty( $instance['title_1'] ) ? $instance['title_1'] : '', $instance, $this->id_base ); $cat_1 = ! empty( $instance[ 'cat_1' ] ) ? $instance[ 'cat_1' ] : absint( 0 ); $icon_2 = ! empty( $instance[ 'icon_2' ] ) ? $instance[ 'icon_2' ] : ''; $title_2 = apply_filters( 'widget_title', ! empty( $instance['title_2'] ) ? $instance['title_2'] : '', $instance, $this->id_base ); $cat_2 = ! empty( $instance[ 'cat_2' ] ) ? $instance[ 'cat_2' ] : absint( 0 ); $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : absint( 4 ); ?>
absint( $cat_1 ), 'posts_per_page' => absint( $post_no ), ); $query_1 = new WP_Query( $arguments_1 ); $i = 0; if( $query_1->have_posts() ) : while( $query_1->have_posts() ) : $query_1->the_post(); if( $i < 1 ) : ?>
have_posts() ) : while( $query_1->have_posts() ) : $query_1->the_post(); if( $i >= 1 ) : ?>
absint( $cat_2 ), 'posts_per_page' => absint( $post_no ), ); $query_2 = new WP_Query( $arguments_2 ); $i = 0; if( $query_2->have_posts() ) : while( $query_2->have_posts() ) : $query_2->the_post(); if( $i < 1 ) : ?>
have_posts() ) : while( $query_2->have_posts() ) : $query_2->the_post(); if( $i >= 1 ) : ?>

Left News

'name', 'hide_empty' => 0, 'id' => $this->get_field_id( 'cat_1' ), 'name' => $this->get_field_name( 'cat_1' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_1 ), 'show_option_all' => esc_html__( 'All Categories', 'newspaper-magazine' ) ); wp_dropdown_categories( $cat_args_1 ); ?>


Right News

'name', 'hide_empty' => 0, 'id' => $this->get_field_id( 'cat_2' ), 'name' => $this->get_field_name( 'cat_2' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_2 ), 'show_option_all' => esc_html__( 'All Categories', 'newspaper-magazine' ) ); wp_dropdown_categories( $cat_args_2 ); ?>