__( 'Display the most recent posts from all categories','mythemeshop' ) ) ); } public function form( $instance ) { $defaults = array( 'comment_num' => 1, 'date' => 1, 'show_thumb2' => 1, 'show_excerpt' => 1, 'excerpt_length' => 10 ); $instance = wp_parse_args((array) $instance, $defaults); $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : __( 'Recent Posts','mythemeshop' ); $qty = isset( $instance[ 'qty' ] ) ? esc_attr( $instance[ 'qty' ] ) : 5; $comment_num = isset( $instance[ 'comment_num' ] ) ? esc_attr( $instance[ 'comment_num' ] ) : 1; $show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? esc_attr( $instance[ 'show_excerpt' ] ) : 1; $date = isset( $instance[ 'date' ] ) ? esc_attr( $instance[ 'date' ] ) : 1; $excerpt_length = isset( $instance[ 'excerpt_length' ] ) ? intval( $instance[ 'excerpt_length' ] ) : 10; $show_thumb2 = isset( $instance[ 'show_thumb2' ] ) ? esc_attr( $instance[ 'show_thumb2' ] ) : 1; $show_excerpt = isset( $instance[ 'show_excerpt' ] ) ? esc_attr( $instance[ 'show_excerpt' ] ) : 1; $excerpt_length = isset( $instance[ 'excerpt_length' ] ) ? intval( $instance[ 'excerpt_length' ] ) : 10; ?>

'; while ( $posts->have_posts() ) { $posts->the_post(); ?>
  • '')); ?> <?php the_title(); ?>
    % '.__('Comments','mythemeshop'));?>

  • '."\r\n"; } } //add_action( 'widgets_init', create_function( '', 'register_widget( "mts_recent_posts_widget" );' ) ); add_action('widgets_init', function(){return register_widget("mts_recent_posts_widget");});