'widget_featured_slider widget_featured_meta', 'description' => __( 'Display latest posts or posts of specific category, which will be used as the slider.', 'colormag' ), ); $control_ops = array( 'width' => 200, 'height' => 250 ); parent::__construct( false, $name = __( 'TG: Featured Category Slider', 'colormag' ), $widget_ops ); } function form( $instance ) { $tg_defaults['number'] = 4; $tg_defaults['type'] = 'latest'; $tg_defaults['category'] = ''; $instance = wp_parse_args( ( array ) $instance, $tg_defaults ); $number = $instance['number']; $type = $instance['type']; $category = $instance['category']; ?>

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, ) ); ?>

$number, 'post_type' => 'post', 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'post_status' => $post_status, ); // Display posts from category. if ( $type == 'category' ) { $args['category__in'] = $category; } $get_featured_posts = new WP_Query( $args ); echo $before_widget; ?>
have_posts() ):$get_featured_posts->the_post(); if ( $i == 1 ) { $classes = "single-slide displayblock"; } else { $classes = "single-slide displaynone"; } ?>
ID ); $image_alt_text = get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true ); $title_attribute = get_the_title( $post->ID ); if ( empty( $image_alt_text ) ) { $image_alt_text = $title_attribute; } $image .= ''; echo $image; } else { ?>