0, 'cat_id_2' => 0, 'post_number' => 5, ); return $defaults; } public function __construct() { $opts = array( 'classname' => 'allure-news-cat_column', 'description' => esc_html__('Two Category Column Widget.', 'allure-news'), ); parent::__construct('allure_news_category_column_widget', esc_html__('Allure News Two Category Column', 'allure-news'), $opts); } public function widget($args, $instance) { $instance = wp_parse_args((array)$instance, $this->defaults()); $cat_id_1 = absint($instance['cat_id_1']); $cat_id_2 = absint($instance['cat_id_2']); $post_number = absint($instance['post_number']); $cat1_class = 'cat-' . $cat_id_1; $cat2_class = 'cat-' . $cat_id_2; echo $args['before_widget']; ?>

'.get_cat_name($cat_id_1). ''); ?>

true, 'post_type' => 'post', 'cat' => $cat_id_1, 'posts_per_page' => $post_number, 'order' => 'DESC' ); $two_category_section_query = new WP_Query($two_category_section); if ($i == 1) { ?>
have_posts()): $two_category_section_query->the_post(); if (has_post_thumbnail()) { ?>
<?php the_title(); ?>

= 2) { ?>
    have_posts()): $two_category_section_query->the_post(); ?>
  • <?php the_title(); ?>

'.(get_cat_name($cat_id_2)). ''); ?>

true, 'post_type' => 'post', 'cat' => $cat_id_2, 'posts_per_page' => $post_number, 'order' => 'DESC' ); $two_category_section_query = new WP_Query($two_category_section); if ($i == 1) { ?>
have_posts()): $two_category_section_query->the_post(); $ID[] = get_the_ID(); if (has_post_thumbnail()) { ?>
<?php the_title(); ?>

= 2) { ?>
    have_posts()): $two_category_section_query->the_post(); ?>
  • <?php the_title(); ?>

defaults()); $cat_id_1 = absint($instance['cat_id_1']); $cat_id_2 = absint($instance['cat_id_2']); $post_number = absint($instance['post_number']); ?>


'name', 'order' => 'asc', 'show_count' => 1, 'hide_empty' => 1, 'echo' => 1, 'selected' => $cat_id_1, 'hierarchical' => 1, 'name' => esc_attr($this->get_field_name('cat_id_1')), 'id' => esc_attr($this->get_field_name('cat_id_1')), 'class' => 'widefat', 'taxonomy' => 'category', 'hide_if_empty' => false, ); wp_dropdown_categories($allure_news_category_col_1_dropown_cat); ?>


'name', 'order' => 'asc', 'show_count' => 1, 'hide_empty' => 1, 'echo' => 1, 'selected' => $cat_id_2, 'hierarchical' => 1, 'name' => esc_attr($this->get_field_name('cat_id_2')), 'id' => esc_attr($this->get_field_name('cat_id_2')), 'class' => 'widefat', 'taxonomy' => 'category', 'hide_if_empty' => false, ); wp_dropdown_categories($allure_news_category_col_2_dropown_cat); ?>