'last-news', 'description' => __('The last news.', 'yiw') ); $control_ops = array( 'id_base' => 'last-news' ); $this->WP_Widget( 'last-news', 'Last News', $widget_ops, $control_ops ); } function widget( $args, $instance ) { extract( $args ); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title'] ); /* Impostazioni di default del widget */ $defaults = array( 'title' => 'Last News', 'items' => 2, 'show_date' => 'yes', 'show_author' => 'yes', ); $instance = wp_parse_args( (array) $instance, $defaults ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; $posts_news = new WP_Query( array( 'post_type' => 'yiw_news', 'posts_per_page' => $instance['items'] ) ); while( $posts_news->have_posts() ) : $posts_news->the_post(); ?>
'; } echo $img; ?>

'Last News', 'items' => 2, 'show_date' => 'yes', 'show_author' => 'yes', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>