__('User Details', 'decents-blog') , ) // Args ); } public function form($instance) { // outputs the options form in the admin $defaults = array( 'posts_style' => 'posts', 'num_posts' => '3', 'posts_title' => '' ); $instance = wp_parse_args((array)$instance, $defaults); $num_posts = !empty($instance['num_posts']) ? absint($instance['num_posts']) : 3; $posts_title = !empty($instance['posts_title']) ? esc_attr($instance['posts_title']) : 'Latest Posts'; $category = !empty($instance['cat']) ? $instance['cat'] : ''; $category_type = !empty($instance['category_type']) ? $instance['category_type'] : ''; ?>

'ID', 'order' => 'ASC', 'show_count' => 1, 'hide_empty' => 1, 'hide_if_empty' => true, 'echo' => 1, 'selected' => $category, 'hierarchical' => 1, 'name' => $this->get_field_name('cat') , 'id' => $this->get_field_id('cat') , 'taxonomy' => 'category', )); ?>

1, 'posts_per_page' => $num_posts, 'post_status' => 'publish', 'orderby' => 'comment_count', 'order' => 'asc' ); if ($category) $post_args['cat'] = $category; $qry = new WP_Query($post_args); echo $before_widget; ?>

have_posts()): while ($qry->have_posts()): $qry->the_post(); if ($posts_style == 'posts1') { ?>
%3$s', esc_url(get_permalink()) , esc_attr(get_the_title()) , wp_trim_words(get_the_title() , 5)); printf('', esc_html(get_the_time(get_option('date_format')))); printf(get_avatar(get_the_author_meta('email') , '30')); ?>
%3$s', esc_url(get_permalink()) , esc_attr(get_the_title()) , wp_trim_words(get_the_title() , 5)); ?>
%3$s', esc_url(get_permalink()) , esc_attr(get_the_title()) , wp_trim_words(get_the_title() , 5)); ?>