'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'];
?>