'List posts, comments, and/or tags with or without tabs.', 'classname' => 'widget_alx_tabs') );; } /* Create tabs-nav /* ------------------------------------ */ private function _create_tabs($tabs,$count) { // Borrowed from Jermaine Maree, thanks mate! $titles = array( 'recent' => __('Recent Posts','hueman'), 'popular' => __('Popular Posts','hueman'), 'comments' => __('Recent Comments','hueman'), 'tags' => __('Tags','hueman') ); $icons = array( 'recent' => 'fa fa-clock-o', 'popular' => 'fa fa-star', 'comments' => 'fa fa-comments-o', 'tags' => 'fa fa-tags' ); $output = sprintf(''; return $output; } /* Widget /* ------------------------------------ */ public function widget($args, $instance) { extract( $args ); $instance['title']?NULL:$instance['title']=''; $title = apply_filters('widget_title',$instance['title']); $output = $before_widget."\n"; if($title) $output .= $before_title.$title.$after_title; ob_start(); /* Set tabs-nav order & output it /* ------------------------------------ */ $tabs = array(); $count = 0; $order = array( 'recent' => $instance['order_recent'], 'popular' => $instance['order_popular'], 'comments' => $instance['order_comments'], 'tags' => $instance['order_tags'] ); asort($order); foreach ( $order as $key => $value ) { if ( $instance[$key.'_enable'] ) { $tabs[] = $key; $count++; } } if ( $tabs && ($count > 1) ) { $output .= $this->_create_tabs($tabs,$count); } ?>
query('showposts='.$instance["recent_num"].'&cat='.$instance["recent_cat_id"].'&ignore_sticky_posts=1');?> array( 'post' ), 'showposts' => $instance['popular_num'], 'cat' => $instance['popular_cat_id'], 'ignore_sticky_posts' => true, 'orderby' => 'comment_count', 'order' => 'dsc', 'date_query' => array( array( 'after' => $instance['popular_time'], ), ), ) ); ?> $instance["comments_num"],'status'=>'approve','post_status'=>'publish')); ?>
'', 'tabs_category' => 1, 'tabs_date' => 1, // Recent posts 'recent_enable' => 1, 'recent_thumbs' => 1, 'recent_cat_id' => '0', 'recent_num' => '5', // Popular posts 'popular_enable' => 1, 'popular_thumbs' => 1, 'popular_cat_id' => '0', 'popular_time' => '0', 'popular_num' => '5', // Recent comments 'comments_enable' => 1, 'comments_avatars' => 1, 'comments_num' => '5', // Tags 'tags_enable' => 1, // Order 'order_recent' => '1', 'order_popular' => '2', 'order_comments' => '3', 'order_tags' => '4', ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>

" />

Recent Posts

>

>

" name="get_field_name("recent_num"); ?>" type="text" value="" size='3' />

$this->get_field_name("recent_cat_id"), 'selected' => $instance["recent_cat_id"], 'show_option_all' => 'All', 'show_count' => true ) ); ?>


Most Popular

>

>

" name="get_field_name("popular_num"); ?>" type="text" value="" size='3' />

$this->get_field_name("popular_cat_id"), 'selected' => $instance["popular_cat_id"], 'show_option_all' => 'All', 'show_count' => true ) ); ?>


Recent Comments

>

>

" name="get_field_name("comments_num"); ?>" type="text" value="" size='3' />


Tags

>


Tab Order

" name="get_field_name("order_recent"); ?>" value="" />

" name="get_field_name("order_popular"); ?>" value="" />

" name="get_field_name("order_comments"); ?>" value="" />

" name="get_field_name("order_tags"); ?>" value="" />


Tab Info

>

>