'feat-cat thumb-posts', 'description' => 'Displaying one big and two smal thumbnails.'); /* Create the widget. */ parent::__construct('one_two_thumb_class', 'Blogazine_wct:Homepage One two Thumbs', $widget_ops); } /** * display the widget on the screen. */ function widget($args, $instance){ extract($args); echo $before_widget; $title = isset($instance['title']) ? $instance['title'] : ''; $cat_id = isset($instance['cat_id']) ? $instance['cat_id'] : ''; //$post_ids = isset($instance['post_ids']) ? $instance['post_ids'] : ''; $order = isset($instance['order']) ? $instance['order'] : ''; $count = isset($instance['count']) ? $instance['count'] : ''; $count = (int) $count; if ( $count < 0 OR $count > 20 ) { $count = 8; } $ids_array = ''; if ( $post_ids ) { $ids_array = array_map( 'trim', explode( ',', $post_ids ) ); } $meta_key = ''; $orderby = 'date'; if ( $order == 'updated' ) { $orderby = 'modified'; } else if ( $order == 'comments' ) { $orderby = 'comment_count'; } else if ( $order == 'views' ) { $meta_key = 'post_views_count'; $orderby = 'meta_value_num'; } else if ( $order == 'random' ) { $orderby = 'rand'; } else if ( $post_ids ){ $orderby = 'post__in'; } else { $orderby = 'date'; } $args = array( 'cat' => $cat_id, 'post__in' => $ids_array, 'post_type' => 'post', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'meta_key' => $meta_key, 'orderby' => $orderby, ); ?>

have_posts() ) : while ( $query -> have_posts() ) : $query -> the_post(); global $post; ?>

'', 'cat_id' => '', 'post_ids' => '', 'count' => 8, 'order' => 'latest'); $instance = wp_parse_args((array) $instance, $defaults); ?>