'widget_featured_single_post clearfix', 'description' => __( 'Display Featured Single Page', 'accelerate' ), 'customize_selective_refresh' => true, ); $control_ops = array( 'width' => 200, 'height' =>250 ); parent::__construct( false, $name= __( 'TG: Featured Single Page', 'accelerate' ), $widget_ops, $control_ops); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'page_id' => '', 'title' => '', 'disable_feature_image' => 0, 'image_position' => 'above' ) ); $title = esc_attr( $instance[ 'title' ] ); $page_id = absint( $instance[ 'page_id' ] ); $disable_feature_image = $instance['disable_feature_image'] ? 'checked="checked"' : ''; $image_position = esc_html( $instance[ 'image_position' ] ); _e( 'Suitable for Business Sidebar and Left/Right Sidebar.', 'accelerate' ); ?>

$this->get_field_name( 'page_id' ), 'selected' => $instance['page_id'] ) ); ?>

id="get_field_id('disable_feature_image'); ?>" name="get_field_name('disable_feature_image'); ?>" />





have_posts() ):$the_query->the_post(); $page_name = get_the_title(); $output = $before_widget; if( $image_position == "below" ) { if( $title ): $output .= $before_title.''. esc_html( $title ).''.$after_title; else: $output .= $before_title.''. esc_html( $page_name ) .''.$after_title; endif; } if( has_post_thumbnail() && $disable_feature_image != "true" ) { $output.= '
'.get_the_post_thumbnail( $post->ID, 'featured', array( 'title' => esc_attr( $page_name ), 'alt' => esc_attr( $page_name ) ) ).'
'; } if( $image_position == "above" ) { if( $title ): $output .= $before_title.''. esc_html( $title ) .''.$after_title; else: $output .= $before_title.''. esc_html( $page_name ) .''.$after_title; endif; } $output .= '

'.get_the_excerpt().'...'.'

'; $output .= ''. __( 'Read more', 'accelerate' ) .''; $output .= $after_widget; endwhile; // Reset Post Data wp_reset_postdata(); echo $output; } } }