'block-layout-a', 'description' => esc_html__( 'News Block Layout Two. Place it within "Frontpage News Layouts Area"', 'best-news' ) ); parent::__construct( 'news-block-layout-two', esc_html__( 'Bnews: News Block Layout 2', 'best-news' ), $opts ); } function form( $instance ) { $title = ! empty( $instance[ 'title' ] ) ? $instance[ 'title' ] : __('Layout 2','best-news'); $cat_1 = ! empty( $instance[ 'cat_1' ] ) ? $instance[ 'cat_1' ] : 0; $cat_2 = ! empty( $instance[ 'cat_2' ] ) ? $instance[ 'cat_2' ] : 0; $cat_3 = ! empty( $instance[ 'cat_3' ] ) ? $instance[ 'cat_3' ] : 0; $cat_4 = ! empty( $instance[ 'cat_4' ] ) ? $instance[ 'cat_4' ] : 0; $author_1 = ! empty( $instance[ 'author_1' ] ) ? $instance[ 'author_1' ] : 0; $orderby = ! empty( $instance[ 'orderby' ] ) ? $instance[ 'orderby' ] : 'date'; $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : 5; $layout_enable = ! empty( $instance[ 'layout_enable' ] ) ? $instance[ 'layout_enable' ] : 'off'; $button_enable = ! empty( $instance[ 'button_enable' ] ) ? $instance[ 'button_enable' ] : 'off'; ?>

id="get_field_id( 'layout_enable' )); ?>" name="get_field_name( 'layout_enable' ) ); ?>" />
id="get_field_id( 'button_enable' )); ?>" name="get_field_name( 'button_enable' ) ); ?>" />



__('All author ','best-news'), 'hide_if_only_one_author' => null, // string 'orderby' => 'display_name', 'order' => 'ASC', 'include' => null, // string 'exclude' => null, // string 'multi' => false, 'show' => 'display_name', 'echo' => true, 'selected' => $author_1, 'include_selected' => false, 'name' => esc_html( $this->get_field_name('author_1') ), 'id' => absint( $this->get_field_id('author_1') ), 'class' => null, // string 'blog_id' => $GLOBALS['blog_id'], 'who' => null, // string, 'role' => null, // string|array, 'role__in' => null, // array 'role__not_in' => null, // array ); wp_dropdown_users($author_args_1); ?>


'name', 'hide_empty' => 1, 'show_count' => 1, 'hierarchical' => 1, 'id' => $this->get_field_id( 'cat_1' ), 'name' => $this->get_field_name( 'cat_1' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_1 ), ); wp_dropdown_categories( $cat_args_1 ); ?>

'name', 'hide_empty' => 1, 'show_count' => 1, 'hierarchical' => 1, 'id' => $this->get_field_id( 'cat_2' ), 'name' => $this->get_field_name( 'cat_2' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_2 ), ); wp_dropdown_categories( $cat_args_2 ); ?>


'name', 'hide_empty' => 1, 'show_count' => 1, 'hierarchical' => 1, 'id' => $this->get_field_id( 'cat_3' ), 'name' => $this->get_field_name( 'cat_3' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_3 ), ); wp_dropdown_categories( $cat_args_3 ); ?>


'name', 'hide_empty' => 1, 'show_count' => 1, 'hierarchical' => 1, 'id' => $this->get_field_id( 'cat_4' ), 'name' => $this->get_field_name( 'cat_4' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_4 ), ); wp_dropdown_categories( $cat_args_4 ); ?>

id_base ); $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : 5; $layout_enable_check = isset( $instance['layout_enable'] ) ? esc_attr( $instance['layout_enable'] ) : ''; $layout_enable = $layout_enable_check ? 'true' : 'false'; $button_enable_check = isset( $instance['button_enable'] ) ? esc_attr( $instance['button_enable'] ) : ''; $button_enable = $button_enable_check ? 'true' : 'false'; echo $args[ 'before_widget' ]; if($layout_enable =='true'): ?>
absint( $cat_1 ), 'posts_per_page' => absint( $post_no ), 'author' => esc_attr( $author_1 ), 'orderby' => array( esc_attr( $orderby ) => 'DSC', 'date' => 'DSC'), ); $query1 = new WP_Query( $arg_1 ); if( $query1->have_posts() ) : ?>
have_posts() ) : $query1->the_post(); if( $count == 0 ) : ?>

have_posts() ) : $query1->the_post(); if( $count > 0 ) :?>

absint( $cat_2 ), 'posts_per_page' => absint( $post_no ), 'author' => esc_attr( $author_1 ), 'orderby' => array( esc_attr( $orderby ) => 'DSC', 'date' => 'DSC'), ); $query2 = new WP_Query( $arg_2 ); if( $query2->have_posts() ) : ?>
have_posts() ) : $query2->the_post(); if( $count == 0 ) : ?>

have_posts() ) : $query2->the_post(); if( $count > 0 ) :?>

absint( $cat_3 ), 'posts_per_page' => absint( $post_no ), 'author' => esc_attr( $author_1 ), 'orderby' => array( esc_attr( $orderby ) => 'DSC', 'date' => 'DSC'), ); $query3 = new WP_Query( $arg_3 ); if( $query3->have_posts() ) : ?>
have_posts() ) : $query3->the_post(); if( $count == 0 ) : ?>

have_posts() ) : $query3->the_post(); if( $count > 0 ) :?>

absint( $cat_4 ), 'posts_per_page' => absint( $post_no ), 'author' => esc_attr( $author_1 ), 'orderby' => array( esc_attr( $orderby ) => 'DSC', 'date' => 'DSC'), ); $query4 = new WP_Query( $arg_4 ); if( $query4->have_posts() ) : ?>
have_posts() ) : $query4->the_post(); if( $count == 0 ) : ?>

have_posts() ) : $query4->the_post(); if( $count > 0 ) :?>