<div class="iblogs-widget <?php echo $css_class; ?>">
  <?php if ($widget_heading) { ?>
    <h3 class="iblogs-line-title iblogs-widget-heading"><?php echo $widget_heading; ?></h3>
  <?php } ?>



  <ul class="nav nav-tabs">
    <li class="active"><a href="#iblogs-widgettab-recent" data-toggle="tab"><?php echo $text_recent; ?></a></li>
    <li><a href="#iblogs-widgettab-popular" data-toggle="tab"><?php echo $text_popular; ?></a></li>
    <li><a href="#iblogs-widgettab-tags" data-toggle="tab"><?php echo $text_tag; ?></a></li>
  </ul>
  <div class="tab-content">

    <div class="tab-pane active iblogs-widgettab-recent" id="iblogs-widgettab-recent">
      <ul class="iblogs-widget-post-list">
        <?php foreach ($posts_recent as $post) { ?>
        <li>
          <div class="iblogs-widget-post-image">
            <a href="<?php echo $post['url_more']; ?>">
              <img src="<?php echo $post['image']; ?>" alt="<?php echo $post['title']; ?>">
            </a>
          </div>
          <div class="iblogs-widget-post-details">
            <a href="<?php echo $post['url_more']; ?>">
              <h5 class="iblogs-widget-post-details-title"><?php echo $post['title']; ?></h5>
            </a>
            <p class="iblogs-widget-post-details-meta"><?php echo $post['publish']; ?></p>
          </div>
        </li>
        <?php } ?>
      </ul>
    </div>

    <div class="tab-pane iblogs-widgettab-popular" id="iblogs-widgettab-popular">
      <ul class="iblogs-widget-post-list">
        <?php foreach ($posts_popular as $post) { ?>
        <li>
          <div class="iblogs-widget-post-image">
            <a href="<?php echo $post['url_more']; ?>">
              <img src="<?php echo $post['image']; ?>" alt="<?php echo $post['title']; ?>">
            </a>
          </div>
          <div class="iblogs-widget-post-details">
            <a href="<?php echo $post['url_more']; ?>">
              <h5 class="iblogs-widget-post-details-title"><?php echo $post['title']; ?></h5>
            </a>
            <p class="iblogs-widget-post-details-meta"><?php echo $post['publish']; ?></p>
          </div>
        </li>
        <?php } ?>
      </ul>
    </div>

    <div class="tab-pane iblogs-widgettab-tags" id="iblogs-widgettab-tags">
      <?php foreach ($posts_tags as $tag) { ?>
        <a href="<?php echo $tag['url']; ?>" title="<?php echo $tag['title']; ?>" class="iblogs-post-tag"><?php echo $tag['title']; ?></a>
      <?php } ?>
    </div>
  </div>

<?php if (!empty($custom_css)) { ?>
<style>
  <?php echo $custom_css; ?>
</style>
<?php } ?>
</div>
