__( 'Display the most recent posts from a single category','arbitragex' ) ) ); } public function form( $instance ) { $defaults = array( 'title_length' => 7, 'comment_num' => 1, 'date' => 1, 'show_thumb1' => 1, 'box_layout' => 'horizontal-small', 'show_excerpt' => 0, 'excerpt_length' => 10 ); $instance = wp_parse_args((array) $instance, $defaults); $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : __( 'Featured Category','arbitragex' ); $title_length = isset( $instance[ 'title_length' ] ) ? intval( $instance[ 'title_length' ] ) : 7; $cat = isset( $instance[ 'cat' ] ) ? intval( $instance[ 'cat' ] ) : 0; $qty = isset( $instance[ 'qty' ] ) ? intval( $instance[ 'qty' ] ) : 5; $comment_num = isset( $instance[ 'comment_num' ] ) ? intval( $instance[ 'comment_num' ] ) : 1; $date = isset( $instance[ 'date' ] ) ? intval( $instance[ 'date' ] ) : 1; $show_thumb1 = isset( $instance[ 'show_thumb1' ] ) ? intval( $instance[ 'show_thumb1' ] ) : 1; $box_layout = $instance['box_layout']; $show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? esc_attr( $instance[ 'show_excerpt' ] ) : 1; $excerpt_length = isset( $instance[ 'excerpt_length' ] ) ? intval( $instance[ 'excerpt_length' ] ) : 10; ?>

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

'; $close_li_item = '
'; } else { $thumbnail = 'widgetfull'; $open_li_item = '
  • '; $close_li_item = '
  • '; } $posts = new WP_Query( "cat=".$cat."&orderby=date&order=DESC&posts_per_page=".$qty ); echo '