'bigbulletin_featured_category_widget', 'description' => esc_html__('Displays post list form selected categories.', 'bigbulletin'), 'customize_selective_refresh' => true, ); $fields = array( 'title_1' => array( 'label' => esc_html__('Title 1:', 'bigbulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_1' => array( 'label' => esc_html__('Select Category 1:', 'bigbulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'bigbulletin'), ), 'title_2' => array( 'label' => esc_html__('Title 2:', 'bigbulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_2' => array( 'label' => esc_html__('Select Category 2:', 'bigbulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'bigbulletin'), ), 'title_3' => array( 'label' => esc_html__('Title 3:', 'bigbulletin'), 'type' => 'text', 'class' => 'widefat', ), 'post_category_3' => array( 'label' => esc_html__('Select Category 3:', 'bigbulletin'), 'type' => 'dropdown-taxonomies', 'show_option_all' => esc_html__('All Categories', 'bigbulletin'), ), ); parent::__construct('bigbulletin-featured-category-layout', esc_html__('BigBulletin: Post List Widget', 'bigbulletin'), $opts, array(), $fields); } /** * Outputs the content for the current widget instance. * * @param array $args Display arguments. * @param array $instance Settings for the current widget instance. * @since 1.0.0 * */ function widget($args, $instance) { $params = $this->get_params($instance); //echo '
';print_r($params);

            $col = 0;
            $class_arr = array('column-12','column-6','column-4');
            for($x = 1; $x <= 3; $x++){
                $section_category = isset($params['post_category_' . $x]) ? $params['post_category_' . $x] : '';
                if($section_category){
                    $col++;
                }
            }

            //print_r($col);

            echo $args['before_widget'];
             ?>

            
'post', 'posts_per_page' => 4, 'post__not_in' => get_option("sticky_posts"), ); $qargs['cat'] = $section_category; $category_list_query = new WP_Query($qargs); if ($category_list_query->have_posts()) : ?>

have_posts()) : $category_list_query->the_post(); if ($count != 1){ $sm_article_panel = 'news-article-list'; $sm_article_image = 'entry-title-small'; } $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large'); $featured_image = isset($featured_image[0]) ? $featured_image[0] : ''; ?>