'apazit-popular-posts','description' => esc_html__( "apazit Popular Posts Widget", 'apazit') ); parent::__construct('apazit_popular_posts', esc_html__('apazit Popular Posts Widget','apazit'), $widget_ops); } function widget($args , $instance) { extract($args); $title = isset($instance['title']) ? $instance['title'] : esc_html__('Popular Posts', 'apazit'); $limit = isset($instance['limit']) ? $instance['limit'] : 5; echo $before_widget; echo $before_title; echo $title; echo $after_title; /** * Widget Content */ ?>
$limit, 'orderby' => 'comment_count', 'order' => 'DESC', 'ignore_sticky_posts' => 1 ); $featured_query = new WP_Query($featured_args); /** * Check if zilla likes plugin exists */ if($featured_query->have_posts()) : while($featured_query->have_posts()) : $featured_query->the_post(); ?>