'popular_posts', 'description' => 'Display popular posts for Prime Theme', ); parent::__construct( 'popular_posts', 'PT Popular posts', $params ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { extract($args); extract($instance); $count = 0; echo $before_widget; echo $before_title. $instance['title'] .$after_title; query_posts('&meta_key=post_views_count&orderby=meta_value_num&order=DESC'); if(have_posts()): while (have_posts() && $post_count != $count): the_post(); ?>
  • '; comments_popup_link( __( 'Leave a comment', 'prime-theme' ), __( '1 Comment', 'prime-theme' ), __( '% Comments', 'prime-theme' ) ); echo ''; } ?>