<?php 
        $item_classes = '';
        $item_skill = '';
        $item_cats = get_the_terms(get_the_ID(), 'portfolio_category');
        foreach ((array) $item_cats as $item_cat) {
            if (count($item_cat) > 0) {
                $item_classes .= $item_cat->slug . ' ';
                $item_skill .= $item_cat->name . ' | ';
            }
        }
        ?>
								<?php 
        if (get_post_meta(get_the_ID(), '_cmb_v_thumb', true) != '') {
            $img = get_post_meta(get_the_ID(), '_cmb_v_thumb', true);
        } else {
            $img = element_thumbnail_url('');
        }
        ?>
								<div class="work-post <?php 
        echo esc_attr($item_classes);
        ?>
 <?php 
        echo get_post_meta(get_the_ID(), "_cmb_portfolio_grid", true);
        ?>
">
									<div class="work-gal">
										<img src="<?php 
        echo esc_attr($img);
        ?>
" alt="<?php 
        the_title();
function shortcode_blog($atts, $content = null)
{
    $atts = shortcode_atts(array('order' => '8', 'id' => '', 'title' => '', 'cat' => ''), $atts);
    if ($atts['cat'] != '' and $atts['cat'] != 'all') {
        $args = array('post_type' => 'post', 'posts_per_page' => $atts['order'], 'category_name' => $atts['cat']);
    } else {
        $args = array('post_type' => 'post', 'posts_per_page' => $atts['order']);
    }
    $blog = new WP_Query($args);
    ob_start();
    ?>
		<div class="blog-box">

			<?php 
    if ($blog->have_posts()) {
        ?>
				<?php 
        $i = 1;
        while ($blog->have_posts()) {
            $blog->the_post();
            ?>
				<?php 
            if ($i % 3 == 1 or $i == 1) {
                ?>
				<div class="row">
				<?php 
            }
            ?>
					<div class="col-md-4">
						<div class="blog-post">
							<div class="blog-gal">
								<?php 
            if (has_post_thumbnail()) {
                $img = element_thumbnail_url('');
                $img_url = bfi_thumb($img, array('width' => 370, 'height' => 280));
            } else {
                $img_url = 'http://placehold.it/370x280';
            }
            ?>
								<img src="<?php 
            echo esc_attr($img_url);
            ?>
" alt="<?php 
            the_title();
            ?>
">
								<div class="blog-hover">
									<a class="zoom" href="<?php 
            echo esc_attr($img_url);
            ?>
"><i class="fa fa-search"></i></a>
								</div>
							</div>
							<div class="blog-content">
								<h2><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
								<ul class="post-tags">
									<li><?php 
            _e('by', 'element');
            ?>
 <?php 
            the_author_posts_link();
            ?>
</li>
									<li><a href="#"><?php 
            the_time('d F Y');
            ?>
</a></li>
									<li><?php 
            the_category(', ');
            ?>
</li>
									<li><span class="comment-number"><i class="fa fa-comment-o"></i> <?php 
            comments_popup_link(__(' 0', 'element'), __(' 1 ', 'element'), __(' % ', 'element'));
            ?>
</span></li>
								</ul>
								<p><?php 
            echo do_shortcode(element_excerpt($limit = 20));
            ?>
</p>
								
							</div>
						</div>								
					</div>
				<?php 
            if ($i % 3 == 0 or $i == $blog->post_count) {
                ?>
		
				</div>
				<?php 
            }
            ?>
				<?php 
            $i++;
        }
        ?>
				<?php 
    } else {
        ?>
				<div class="not-found">
						<h1><?php 
        _e('Nothing Found Here!', 'element');
        ?>
</h1>
						<h3><?php 
        _e('Search with other string:', 'element');
        ?>
</h3>
						<div class="search-form">
								<?php 
        get_search_form();
        ?>
						</div>
				</div>
				<?php 
    }
    ?>

		</div>
		
<?php 
    return ob_get_clean();
}
<?php

/*
*Template Name: Vertical Inner
*/
get_header();
global $wp_query, $element_options;
?>
		<!-- content 
			================================================== -->
		<div id="content" class="banner-photo1" style="background-image: url(<?php 
echo esc_attr(element_thumbnail_url(''));
?>
);">
			<?php 
if (get_post_meta($wp_query->get_queried_object_id(), '_cmb_page_breadcrumb', true) != "yes") {
    ?>
			<!-- page-banner-section
				================================================== -->
			<div class="section-content page-banner-section">
				<?php 
    if ($element_options['body_style'] == 'vertical-dark') {
        ?>
					<div class="page-banner-box">
				<?php 
    }
    ?>
						<div class="container">
							<h1><?php 
    single_post_title();
    ?>
    public function widget($args, $instance)
    {
        $title = apply_filters('widget_title', $instance['title']);
        // before and after widget arguments are defined by themes
        echo $args['before_widget'];
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        // This is where you run the code and display the output
        ?>

<!-- POPULAR POSTS WIDGET -->
<div class="recent-widget">
<ul class="recent-list">
	<?php 
        //echo $instance['count'].'asd';
        $arr = array('post_type' => 'post', 'posts_per_page' => $instance['count']);
        $query = new WP_Query($arr);
        while ($query->have_posts()) {
            $query->the_post();
            ?>
	<li>
	
		<?php 
            if (has_post_thumbnail()) {
                // Get the URL of our processed image
                $image = bfi_thumb(element_thumbnail_url(''), array('width' => 70, 'height' => 65));
                ?>
		
		<img alt="<?php 
                the_title();
                ?>
" src="<?php 
                echo esc_attr($image);
                ?>
" />
		<?php 
            } else {
                ?>
		<img alt="<?php 
                the_title();
                ?>
" src="http://placehold.it/70x65" />
		<?php 
            }
            ?>
		<div class="side-content">
			<h2><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
			<p><?php 
            the_time('F d, Y');
            ?>
</p>
		</div>
	</li>
<?php 
        }
        wp_reset_postdata();
        ?>
</ul>
</div><!-- //POPULAR POSTS WIDGET -->

<?php 
        echo $args['after_widget'];
    }