'', 'show' => 6, 'desc' => true, 'autoslide' => 0, 'cats' => null ); /* Widget setup */ function __construct() { /* Widget settings. */ $widget_ops = array( 'description' => __('A widget with slider', LANGUAGE_ZONE) ); /* Create the widget. */ parent::__construct( 'dt-slider-widget', DT_WIDGET_PREFIX . __('Slider', LANGUAGE_ZONE), $widget_ops ); } /* Display the widget */ function widget( $args, $instance ) { extract( $args ); $instance = wp_parse_args( (array) $instance, $this->dt_defaults ); /* Our variables from the widget settings. */ $title = apply_filters('widget_title', $instance['title'] ); $autoslide = $instance['autoslide']; $autoslide_on = $autoslide ? 1 : 0; global $wpdb, $post; $args = array( 'no_found_rows' => 1, 'posts_per_page' => 1 , 'post_type' => 'dt_slider', 'post_status' => 'publish', 'post__in' => array($instance['cats']) ); $p_query = new WP_Query( $args ); echo $before_widget ; // start echo $before_title . $title . $after_title; ?>
'; $caption .= '' . $slide['caption'] . '
'; $caption .= $slide_link . '
'dt_slider',
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC'
) );
if( $slides->have_posts() ):
if( empty($instance['cats']) ) {
$instance['cats'] = $slides->posts[0]->ID;
}
?>
posts as $slide ): ?>
ID == $instance['cats'] ); ?>/>
milliseconds
(1 second = 1000 milliseconds; to disable autoslide leave this field blank or set it to "0")