'post_plugin', 'description' => __('Widget to display post details', 'wp_post_plugin')); $control_ops = array('width' => 200, 'height' => 250); parent::WP_Widget(false, $name = __('AWP Featured Posts', 'wp_post_plugin'), $widget_ops, $control_ops ); } public function form($instance) { $defaults = array( 'title' => __('Featured Posts'), 'post_count' => '5' , 'check_image'=> '0', 'check_category'=> '0', 'check_author'=> '0', 'check_comments'=> '0', 'check_excerpt'=> '0', 'check_views'=> '0', 'check_date'=> '0', 'posts_category'=> '' ); $instance = wp_parse_args( (array) $instance, $defaults ); if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; $post_count=$instance['post_count']; } else { $title =$defaults['title']; $post_count=$defaults['post_count']; } $category = $instance['posts_category']; ?>
id="get_field_id('check_image'); ?>" name="get_field_name('check_image'); ?>" />
id="get_field_id('check_date'); ?>" name="get_field_name('check_date'); ?>" />
id="get_field_id('check_author'); ?>" name="get_field_name('check_author'); ?>" />
id="get_field_id('check_category'); ?>" name="get_field_name('check_category'); ?>" />
id="get_field_id('check_comments'); ?>" name="get_field_name('check_comments'); ?>" />
id="get_field_id('check_excerpt'); ?>" name="get_field_name('check_excerpt'); ?>" />
id="get_field_id('check_views'); ?>" name="get_field_name('check_views'); ?>" />
$this->get_field_name( 'posts_category' ), 'selected' => $category, 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __( 'All Categories', 'genesis' ), 'hide_empty' => '0', ); wp_dropdown_categories( $categories_args ); ?>
$post_count, "post_type" => "post", "post_status" => "publish", "order" => "DESC", 'cat' => $category ) ); global $post; if($arg->have_posts()) { echo "This post has "; comments_number(); echo "
"; } if($instance['check_views']){ echo ""; awp_show_views(); echo "
"; } echo'