/**
     * Display widget content.
     *
     * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
     * @param array $instance The settings for the particular instance of the widget
     */
    function widget($args, $instance)
    {
        global $wp_query, $calibrefx;
        extract($args);
        $instance = wp_parse_args((array) $instance, $this->defaults);
        echo $before_widget;
        if (!empty($instance['title'])) {
            echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
        }
        $query = new WP_Query(array('posts_per_page' => $instance['num_posts'], 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => true));
        $no_post_thumbnail = apply_filters('no_thumbnail_image_url', CALIBREFX_IMAGES_URL . '/no-image.jpg');
        echo '<ul class="list-latest-posts">';
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                $img = calibrefx_get_image(array('format' => 'html', 'size' => $instance['image_size']));
                $img = !empty($img) ? $img : '<img src="' . $no_post_thumbnail . '" />';
                $date_format = get_option('date_format');
                $item_class = apply_filters('calibrefx_latest_posts_item_class', calibrefx_row_class());
                $image_class = apply_filters('calibrefx_latest_posts_image_class', col_class(12, 4, 4));
                $content_class = apply_filters('calibrefx_latest_posts_content_class', col_class(12, 8, 8));
                if ($instance['show_thumbnail']) {
                    echo '
						<li>
							<div class="' . $item_class . ' latest-post-item">
								<div class="latest-post-thumb ' . $image_class . '">
									<a href="' . get_permalink() . '" class="thumbnail">' . $img . '</a>
								</div>
								<div class="latest-post-detail ' . $content_class . '">
									<h5 class="latest-post-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>
									<p class="latest-post-info">' . do_shortcode('[post_date]') . '</p>
									' . ($instance['show_detail'] ? get_the_content_limit($instance['detail_length']) : '') . '
								</div>
							</div>
						</li>
					';
                } else {
                    echo '
						<li>
							<div class="' . calibrefx_row_class() . ' latest-post-item">
								<div class="latest-post-detail col-lg-12 col-md-12 col-sm-12 col-xs-12">
									<h5 class="latest-post-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>
									<p class="latest-post-date">' . date($date_format, get_the_time('U')) . '</p>
									' . ($instance['show_detail'] ? get_the_content_limit($instance['detail_length']) : '') . '
								</div>
							</div>
						</li>
					';
                }
            }
        } else {
            echo '<li>' . __('There is no post available yet', 'calibrefx') . '</li>';
        }
        echo '</ul>';
        echo $after_widget;
        wp_reset_query();
        wp_reset_postdata();
    }
function calibrefx_tbcol($atts, $content = null)
{
    extract(shortcode_atts(array('col' => '1', 'offset' => ''), $atts));
    $offset_class = '';
    if ($offset != '') {
        $offset_class = ' ' . col_offset_class(explode(',', $offset));
    }
    return "<div class='" . col_class(explode(',', $col)) . "{$offset_class}'>" . do_shortcode(advance_shortcode_unautop($content)) . '</div>';
}