esc_html__( 'Display two columns of categories', 'simple-days' ), ) // Args ); } /** * Set default settings of the widget */ private function default_settings() { $defaults = array( 'title_left' => esc_html__( 'Category', 'simple-days' ), 'category_left' => 0, 'title_right' => esc_html__( 'Category', 'simple-days' ), 'category_right' => 0, 'number_post' => 4, 'date' => true, 'image_size' => 'thumbnail', 'heading_image_size' => 'medium', 'random' => false, 'sticky_posts' => true, 'include_page' => false, 'to_main_content' => false, ); return $defaults; } public function widget( $args, $instance ) { $settings = wp_parse_args( $instance, $this->default_settings() ); $orderby = 'date'; if($settings['random'])$orderby = 'rand'; $post_type = array('post'); if($settings['include_page']) $post_type = array('post','page'); include_once SIMPLE_DAYS_THEME_DIR . 'template-parts/custom_hp/hp-category_heading.php'; include_once SIMPLE_DAYS_THEME_DIR . 'template-parts/custom_hp/hp-category_from_2nd.php'; $angle = array('left','right'); $grid_margin = array('left' => 'ch_sep','right' => ''); echo $args['before_widget']; echo '
esc_html__( 'All Categories', 'simple-days' ), 'show_count' => true, 'hide_empty' => false, 'selected' => $settings['category_left'], 'name' => $this->get_field_name( 'category_left' ), 'id' => $this->get_field_id( 'category_left' ), 'depth' => 1, 'hierarchical' => true, ); wp_dropdown_categories( $args ); ?>
esc_html__( 'All Categories', 'simple-days' ), 'show_count' => true, 'hide_empty' => false, 'selected' => $settings['category_right'], 'name' => $this->get_field_name( 'category_right' ), 'id' => $this->get_field_id( 'category_right' ), 'depth' => 1, 'hierarchical' => true, ); wp_dropdown_categories( $args ); ?>
class="checkbox" id="get_field_id('date'); ?>" name="get_field_name('date'); ?>" />
class="checkbox" id="get_field_id('random'); ?>" name="get_field_name('random'); ?>" />
class="checkbox" id="get_field_id('sticky_posts'); ?>" name="get_field_name('sticky_posts'); ?>" />
class="checkbox" id="get_field_id( 'include_page' ) ); ?>" name="get_field_name( 'include_page' ) ); ?>" />
class="checkbox" id="get_field_id( 'to_main_content' ) ); ?>" name="get_field_name( 'to_main_content' ) ); ?>" />