'carousel-news-section', 'description' => esc_html__( 'Widget to display carousel.', 'basic-blog' ), ); parent::__construct( 'carousel-news-section', esc_html__( 'Basic Blog: Carousel', 'basic-blog' ), $opts ); } function widget( $args, $instance ) { $mix_category = !empty( $instance[ 'mix_category' ] ) ? $instance[ 'mix_category' ] : 0; $post_number = !empty( $instance[ 'post_number' ] ) ? $instance[ 'post_number' ] : 5; echo $args[ 'before_widget' ]; ?>
'name', 'hide_empty' => 0, 'class' => 'widefat', 'taxonomy' => 'category', 'name' => $this->get_field_name( 'mix_category' ), 'id' => $this->get_field_id( 'mix_category' ), 'selected' => absint( $instance[ 'mix_category' ] ), 'show_option_all' => esc_html__( 'All Categories', 'basic-blog' ), ); wp_dropdown_categories( $cat_args ); ?>
dropdown_post_number( array( 'id' => $this->get_field_id( 'post_number' ), 'name' => $this->get_field_name( 'post_number' ), 'selected' => absint( $instance[ 'post_number' ] ), ) ); ?>
'', 'name' => '', 'selected' => 0, ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, '10' => 10, '11' => 11, '12' => 12, '13' => 13, '14' => 14, '15' => 15, '16' => 16, ); if ( !empty( $choices ) ) { $output = "\n"; } echo $output; } } endif;