'widget_featured_post_slider', 'description' => __( 'Display latest posts or posts of specific category, which will be used as the slider.', 'envince' ), ); $control_ops = array( 'width' => 200, 'height' => 250, ); parent::__construct( false, $name = __( 'TG: Featured Post Slider', 'envince' ), $widget_ops ); } function form( $instance ) { $envince_defaults['number'] = 5; $envince_defaults['type'] = 'latest'; $envince_defaults['category'] = ''; $envince_defaults['child_category'] = '0'; $instance = wp_parse_args( (array) $instance, $envince_defaults ); $number = $instance['number']; $type = $instance['type']; $category = $instance['category']; $child_category = $instance['child_category'] ? 'checked="checked"' : ''; ?>

id="get_field_id( 'type' ); ?>" name="get_field_name( 'type' ); ?>" value="latest" />
id="get_field_id( 'type' ); ?>" name="get_field_name( 'type' ); ?>" value="category" />

' ', 'name' => $this->get_field_name( 'category' ), 'selected' => $category, ) ); ?>

id="get_field_id( 'child_category' ); ?>" name="get_field_name( 'child_category' ); ?>" type="checkbox" />

$number, 'post_type' => 'post', 'ignore_sticky_posts' => true, 'no_found_rows' => true, ) ); } else { if ( $child_category == 'true' ) { $get_featured_posts = new WP_Query( array( 'posts_per_page' => $number, 'post_type' => 'post', 'cat' => $category, 'no_found_rows' => true, ) ); } else { $get_featured_posts = new WP_Query( array( 'posts_per_page' => $number, 'post_type' => 'post', 'category__in' => $category, 'no_found_rows' => true, ) ); } } echo $before_widget; ?>
have_posts() ):$get_featured_posts->the_post(); $slide_counter ++; if ( $slide_counter % 5 == 1 ) { ?>
'; } ?>
"; } // wrapper for small grid } if ( $slide_counter % 5 == 0 ) { ?>