'amty_thumb', 'description' => __('It displays recently published posts with thumbnail', 'amtyThumb_posts') ); /* Widget control settings. */ $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'amty-thumb-recent' ); /* Create the widget. */ $this->WP_Widget( 'amty-thumb-recent', __('Amty Thumb Posts', 'amtyThumb_posts'), $widget_ops, $control_ops ); } function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and width & Height to remove HTML (important for text inputs). */ $instance['title'] = strip_tags( $new_instance['title'] ); $instance['maxpost'] = strip_tags( $new_instance['maxpost'] ); $instance['width'] = strip_tags( $new_instance['width'] ); $instance['height'] = strip_tags( $new_instance['height'] ); $instance['border'] = strip_tags( $new_instance['border'] ); $instance['itemwidth'] = strip_tags( $new_instance['itemwidth'] ); $instance['itemheight'] = strip_tags( $new_instance['itemheight'] ); $instance['itemborder'] = strip_tags( $new_instance['itemborder'] ); $instance['titlelen'] = strip_tags( $new_instance['titlelen'] ); /* No need to strip tags for icon */ $instance['icon'] = $new_instance['icon']; $instance['icontype'] = $new_instance['icontype']; //'uploaded','attached','referenced' //$instance['show_default'] = $new_instance['show_default']; $instance['imagepath'] = $new_instance['imagepath']; $instance['pretag'] = $new_instance['pretag']; $instance['posttag'] = $new_instance['posttag']; $instance['displaytype'] = $new_instance['displaytype']; $instance['templateItems'] = $new_instance['templateItems']; $instance['category'] = $new_instance['category']; $instance['widgettype'] = $new_instance['widgettype']; return $instance; } function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title' => __('Amty Thumb Posts', 'amtyThumb_posts'), 'width' => __('70', 'amtyThumb_posts'), 'height' => __('70', 'amtyThumb_posts'), 'border' => __('1', 'amtyThumb_posts'), 'icon' => 'yes', 'icontype' => 'any', //'uploaded','referenced','attached','any' 'imagepath' => __('', 'amtyThumb_posts'), 'pretag' => __('', 'amtyThumb_posts'), 'posttag' => __('', 'amtyThumb_posts'), 'titlelen' => __(50, 'amtyThumb_posts'), 'displaytype' => __('Vertically', 'amtyThumb_posts'), 'templateItems' => __('image', 'amtyThumb_posts'), 'itemwidth' => __('50', 'amtyThumb_posts'), 'itemheight' => __('50', 'amtyThumb_posts'), 'itemborder' => __('0', 'amtyThumb_posts'), 'maxpost' => __('5', 'amtyThumb_posts'), 'category' => __('All','amtyThumb_posts'), 'widgettype' => __('Recent','amtyThumb_posts') ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

Posts, Category :


Thumbnail


First Image.

id="get_field_id( 'show_default'); ?>" name="get_field_name( 'show_default'); ?>" />

*/?>


Title


Template

View: Show first.

In case of Horizontal view



'Amty Thumb Posts', //'' to hide it 'before_title' => '

', 'after_title' => '

', 'thumb_width' => '70', 'thumb_height' => '70', 'thumb_border' => '1', 'show_thumb' => 'yes', 'image_type' => 'any', //'attached','any','referenced', 'uploaded' 'imagepath' => '', 'pretag' => '', 'posttag' => '', 'title_len' => 30, 'display_type' => 'Vertically', //'Horizontally','Vertically' 'display_first' => 'image', //'image','title' 'box_width' => '50', 'title_box_height' => '50', 'box_border' => '0', 'max_post' => '5', 'category' => 'All', 'widgettype' => 'Recent' //'Recent','Random','Popular' ), $attr ) ); displayPosts($before_title, $after_title,$title, $thumb_width,$thumb_height,$thumb_border,$max_post,$show_thumb,$imagepath,$image_type,$pretag,$posttag,$display_type,$display_first,$box_width,$title_box_height,$box_border,$title_len,$category,$widgettype); } function displayPosts($before_title, $after_title, $title = '',$width = 70,$height = 70 ,$border = 0 ,$maxpost = 5,$icon ,$imagepath = '',$icontype ,$pretag = '',$posttag = '',$displaytype = 'Vertically',$templateItems = 'image',$itemwidth = '50',$itemheight = '50',$itemborder = 0,$titlelen = 30,$categoryName = 'All',$widgetType = 'Recent'){ if ( $title != '' ) echo $before_title . $title . $after_title; ?> ">