'widget trending-and-latest-tab-section', 'description' => esc_html__( 'Add Widget to Display Trending/Popular Post.', 'buzz-magazine' ), 'customize_selective_refresh' => true, ); parent::__construct( 'buzz_magazine_latest_trend', esc_html__( 'Buzz Magazine Sidebar: Latest/Popular', 'buzz-magazine' ), $widget_ops ); } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'trend_post_per' => 4, 'latest_post_per' => 4, 'display_content' => true, 'show_post_meta' => true, 'display_category' => true, ) ); $display_category = isset( $instance['display_category'] ) ? (bool) $instance['display_category'] : true; $trend_post_per = isset( $instance['trend_post_per'] ) ? absint( $instance['trend_post_per'] ) : 4; $display_content = isset( $instance['display_content'] ) ? (bool) $instance['display_content'] : true; $latest_post_per = isset( $instance['latest_post_per'] ) ? absint( $instance['latest_post_per'] ) : 4; $show_post_meta = isset( $instance['show_post_meta'] ) ? (bool) $instance['show_post_meta'] : true; ?>

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

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

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

absint( $trend_post_per ), 'post_type' => 'post', 'post_status' => 'publish', 'post__not_in' => get_option( 'sticky_posts' ), ); $query_popular_post = new WP_Query( $latest_args ); if ($query_popular_post->have_posts()) : $count= 0; ?> absint( $latest_post_per ), 'post_type' => 'post', 'post_status' => 'publish', 'orderby' => 'comment_count', 'post__not_in' => get_option( 'sticky_posts' ), ); $query_trend_post = new WP_Query( $args ); if ($query_trend_post->have_posts()) : $count= 0; ?>
have_posts() ): $query_trend_post->the_post(); ?>