__( 'Display Featured Post. Suitable for Home Top Area and Home Left Area', 'foodland' ) ) // Args ); } function form( $instance ) { global $foodland_valid_id; //Defaults $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'post_id' => '', 'disable_featured_image' => 0, 'image_position' => 'above', 'show_content' => 'excerpt', 'excerpt_length' => 200 ) ); $post_id = absint( $instance['post_id'] ); $title = esc_attr( $instance['title'] ); $disable_featured_image = $instance['disable_featured_image'] ? 'checked="checked"' : ''; $image_position = $instance['image_position']; $show_content = $instance['show_content']; $excerpt_length = absint( $instance['excerpt_length'] ); ?>


'. __( 'This Post ID is Not Valid', 'foodland' ) .''; } } ?>

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





have_posts() ) : $the_query->the_post(); $post_name = the_title( '', '', false ); $output = $before_widget; $output .= '
'; //Image position set below if( $image_position == "below" ) { // Wiget title replace the page title is added if( $title ) { $output .= '

'. esc_html( $title ) .'

'; } else { $output .= '

'. esc_html( $post_name ) .'

'; } } if( has_post_thumbnail() && $disable_featured_image != "true" ) { $output.= ''; } //Image position set above if( $image_position == "above" ) { // Wiget title replace the page title is added if( $title ) { $output .= '

'. esc_html( $title ) .'

'; } else { $output .= '

'. esc_html( $post_name ) .'

'; } } if ( 'excerpt' == $show_content ) { $excerpt = foodland_get_the_content_limit( (int) $excerpt_length, __( 'Read more...', 'foodland' ) ); $output .= '
'; $output .= wp_kses_data( $excerpt ); $output .= '
'; } elseif ( 'fullcontent' == $show_content ) { $content = apply_filters( 'the_content', get_the_content() ); $content = str_replace( ']]>', ']]>', $content ); $output .= '
' . wp_kses_data( $content ) . '
'; } $output .= '
'; $output .= $after_widget; endwhile; // Reset Post Data wp_reset_postdata(); echo $output; endif; } }