'',
'description' => esc_html__( 'Displays three distinct highlight posts. Place it in "Highlight Widget Area" widget area.', 'newspaper-magazine' )
);
parent::__construct( 'newspaper-magazine-main-highlight', esc_html__( 'Main Highlight', 'newspaper-magazine' ), $opts );
}
function widget( $args, $instance ) {
$cat_1 = ! empty( $instance[ 'cat_1' ] ) ? $instance[ 'cat_1' ] : absint( 0 );
$cat_2 = ! empty( $instance[ 'cat_2' ] ) ? $instance[ 'cat_2' ] : absint( 0 );
$cat_3 = ! empty( $instance[ 'cat_3' ] ) ? $instance[ 'cat_3' ] : absint( 0 );
?>
'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 ); ?>
'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 ); ?>
'name', 'hide_empty' => 0, 'id' => $this->get_field_id( 'cat_3' ), 'name' => $this->get_field_name( 'cat_3' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat_3 ), 'show_option_all' => esc_html__( 'All Categories', 'newspaper-magazine' ) ); wp_dropdown_categories( $cat_args_3 ); ?>
'', 'description' => esc_html__( 'Displays posts as slider. Place it in "Highlight Wiget Area" widget area. It only works in the widget area.', 'newspaper-magazine' ) ); parent::__construct( 'newspaper-magazine-slider-highlight', esc_html__( 'Slider Highlight', 'newspaper-magazine' ), $opts ); } function widget( $args, $instance ) { $cat = ! empty( $instance[ 'cat' ] ) ? $instance[ 'cat' ] : absint( 0 ); $post_no = ! empty( $instance[ 'post_no' ] ) ? $instance[ 'post_no' ] : absint( 5 ); $arguments = array( 'cat' => absint( $cat ), 'posts_per_page' => absint( $post_no ), 'post_type' => 'post', 'post__not_in'=>get_option("sticky_posts") ); $query = new WP_Query( $arguments ); ?>'name', 'hide_empty' => 0, 'id' => $this->get_field_id( 'cat' ), 'name' => $this->get_field_name( 'cat' ), 'class' => 'widefat', 'taxonomy' => 'category', 'selected' => absint( $cat ), 'show_option_all' => esc_html__( 'All Categories', 'newspaper-magazine' ) ); wp_dropdown_categories( $cat_args ); ?>