'widget_video', 'description' => __( 'Popster - Latest video', 'popster') ); // Create the widget. parent::__construct('video_popster', __('Popster - Latest video', 'popster'), $widget_ops); } function widget($args, $instance) { extract( $args ); $default = array('widget_title'=>__('Latest Videos','popster'), 'id'=> '', 'qty'=>1 ); $instance = wp_parse_args($instance, $default); $widget_title = apply_filters('widget_title', $instance['widget_title']); $id = $instance['id']; $qty = $instance['qty']; // WIDGET OUTPUT echo $before_widget; ?>
array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-video' ) ), 'showposts' => $qty ); $r = new WP_Query($args); $post_found = count($r->posts); $i = 1; while ($r->have_posts()) : $r->the_post(); ?>

Video of

__('Latest Videos','popster'), 'id'=> '', 'qty'=>1 ); $instance = wp_parse_args($instance, $default); $widget_title = $instance['widget_title']; $qty = $instance['qty']; ?>

Widget title:

Quantity: