Ejemplo n.º 1
0
function blox_parse_imageslider_hook($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'images' => '', 'layout' => '1', 'lightbox' => '1', 'extra_class' => ''), $atts));
    $uid = uniqid();
    if ($images != '') {
        $img_array = explode(',', $images);
        $html = '';
        foreach ($img_array as $img_id) {
            $attach_url = wp_get_attachment_url($img_id);
            $img = blox_aq_resize($attach_url, 80, 80, true);
            $prev = '';
            if ($layout == '2') {
                $prev = blox_aq_resize($attach_url, 800, 640, true);
                $prev = $prev != '' ? $prev : $attach_url;
            } else {
                if ($layout == '4') {
                    $prev = blox_aq_resize($attach_url, 800, 480, true);
                    $prev = $prev != '' ? $prev : $attach_url;
                }
            }
            $html .= '<a href="' . $attach_url . '" data-preview="' . $prev . '" rel="blox_imageslider[' . $uid . ']"><img src="' . $img . '" /></a>';
        }
        $html = "<div class='blox_element blox_imageslider gallery_layout{$layout} {$extra_class}'><span class='gallery_preview'></span><span class='gallery_thumbs'>{$html}</span></div>";
        return $html;
    }
    return 'No slider images!';
}
Ejemplo n.º 2
0
function blox_testimonial_item_hook($atts, $content = null)
{
    extract(shortcode_atts(array('author' => '', 'position' => '', 'company' => '', 'image' => ''), $atts));
    $img = $image != '' ? "<span class='quote-image'><img src='" . blox_aq_resize($image, 50, 50, true) . "' alt='Author'/></span>" : '';
    $noimageclass = $img == '' ? 'no-image-quote' : '';
    return '<div class="quote-item">
                ' . $img . '
                <blockquote class="quote-text ' . $noimageclass . '"><p>' . do_shortcode($content) . '</p><footer>' . $author . ' <span class="company">' . $company . '</span> <span class="position">' . $position . '</span></footer></blockquote>
                <div class="clearfix"></div>
            </div>';
}
Ejemplo n.º 3
0
function blox_parse_gallery_hook($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'images' => '', 'layout' => 'default', 'animation' => '', 'extra_class' => '', 'visibility' => ''), $atts));
    $title = isset($title) && $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : '';
    $is_animate = $animation != 'none' && $animation != '' ? 'animate' : '';
    $visibility = str_replace(',', ' ', $visibility);
    $extra_class .= " {$visibility} {$is_animate}";
    if ($images != '') {
        $img_array = explode(',', $images);
        $html = '';
        foreach ($img_array as $img_id) {
            $attach_url = wp_get_attachment_url($img_id);
            $attach_url = $attach_url !== false ? $attach_url : THEME_NOIMAGE;
            $img = $attach_url;
            $img = $layout == 'imac' ? blox_aq_resize($attach_url, 800, 450, true) : $img;
            $img = $layout == 'laptop' ? blox_aq_resize($attach_url, 800, 500, true) : $img;
            $img = $layout == 'iphone' ? blox_aq_resize($attach_url, 640, 1130, true) : $img;
            $img = $layout == '' || $layout == 'default' ? blox_aq_resize($attach_url, 960, 540, true) : $img;
            $alt = get_post_meta($img_id, '_wp_attachment_image_alt', true);
            $html .= '<div class="swiper-slide">
						<img src="' . $img . '" style="width:100%;" alt="' . $alt . '" class="img-responsive" />
                      </div>';
        }
        $result = '<div class="swiper-container swipy-slider">
	                    <div class="swiper-wrapper">' . $html . '</div>
	                    <div class="swiper-control-prev"><i class="fa-angle-left"></i></div>
	                    <div class="swiper-control-next"><i class="fa-angle-right"></i></div>
	                    <div class="swiper-pagination"></div>
	               </div>';
        if (in_array($layout, array('imac', 'laptop', 'iphone', 'iphone_landscape', 'ipad', 'ipad_landscape'))) {
            $device = $layout;
            $device = $layout == 'laptop' ? 'macbook' : $layout;
            $device = $layout == 'iphone' ? 'iphone5 portrait white' : $device;
            $device = $layout == 'iphone_landscape' ? 'iphone5 landscape white' : $device;
            $device = $layout == 'ipad' ? 'ipad portrait black' : $device;
            $device = $layout == 'ipad_landscape' ? 'ipad landscape black' : $device;
            $result = '<div class="device-mockup ' . $device . '">
			                <div class="device">
			                    <div class="screen">
			                        <div class="gallery_viewport">' . $result . '</div>
			                    </div>
			                    <div class="button"></div>
			                </div>
			           </div>';
        }
        return '<div class="blox-element blox-gallery ' . $extra_class . '" data-animate="' . $animation . '">
					' . $title . $result . '
		        </div>';
    }
    return '';
}
Ejemplo n.º 4
0
function ttwc_before_shop_loop_item_title($param)
{
    global $product;
    $id = get_the_ID();
    $size = 'full';
    echo "<div class='product-thumbnail'>";
    echo "<div class='product-image-hover' style='height: 263px;'>";
    echo " <a href='" . get_permalink($id) . "'>";
    $first_img = ttwc_gallery_first_thumbnail($id, $size);
    if ($first_img != '') {
        $first_img = blox_aq_resize($first_img, 480, 480, true);
        echo '<img itemprop="image" src="' . $first_img . '" class="product-hover" />';
    } else {
        $fimage = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full');
        $fimage = blox_aq_resize($fimage[0], 480, 480, true);
        echo '<img itemprop="image" src="' . $fimage . '" />';
    }
    $fimage = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full');
    if (isset($fimage[0]) && $fimage[0] != '' && $fimage[0] != NULL && $fimage[0] != 'NULL') {
        $fimage = blox_aq_resize($fimage[0], 480, 480, true);
        echo '<img itemprop="image" src="' . $fimage . '" />';
    } else {
        $first_img = blox_aq_resize($first_img, 480, 480, true);
        echo '<img itemprop="image" src="' . $first_img . '" class="product-hover" />';
    }
    echo "</a>";
    echo "<div class='cart-and-rating'>";
    echo "<div class='pull-left text-left'>";
    woocommerce_get_template('loop/add-to-cart.php');
    echo "</div>";
    echo "<div class='pull-right text-right'>";
    woocommerce_get_template('loop/rating.php');
    echo "</div>";
    echo "<div class='clearfix'></div>";
    echo '</div>';
    echo "</div>";
    if ($product->product_type == 'simple') {
        echo "<span class='cart-loading'></span>";
    }
    echo "</div>";
}
Ejemplo n.º 5
0
function blox_parse_logos_hook($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'images' => '', 'layout' => 'default', 'carousel' => 1, 'slideseconds' => 5, 'tooltip' => 1, 'grayscale' => 1, 'animation' => '', 'extra_class' => '', 'visibility' => ''), $atts));
    $title = isset($title) && $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : '';
    $is_animate = $animation != 'none' && $animation != '' ? 'animate' : '';
    $visibility = str_replace(',', ' ', $visibility);
    $extra_class .= " {$visibility} {$is_animate}";
    if ($images != '') {
        $img_array = explode(',', $images);
        $html = '';
        foreach ($img_array as $img_id) {
            $attach_url = wp_get_attachment_url($img_id);
            $attach_url = $attach_url !== false ? $attach_url : THEME_NOIMAGE;
            $img = $attach_url;
            $img = $layout == 'imac' ? blox_aq_resize($attach_url, 800, 450, true) : $img;
            $img = $layout == 'laptop' ? blox_aq_resize($attach_url, 800, 500, true) : $img;
            $img = $layout == 'iphone' ? blox_aq_resize($attach_url, 640, 1130, true) : $img;
            $img = $layout == '' || $layout == 'default' ? blox_aq_resize($attach_url, 960, 540, true) : $img;
            $alt = get_post_meta($img_id, '_wp_attachment_image_alt', true);
            $html .= '<div class="swiper-slide">
						<img src="' . $img . '" style="width:100%;" alt="' . $alt . '" class="img-responsive" />
                      </div>';
        }
        $result = '<div class="swiper-container swipy-slider">
	                    <div class="swiper-wrapper">' . $html . '</div>
	                    <div class="swiper-control-prev"><i class="fa-angle-left"></i></div>
	                    <div class="swiper-control-next"><i class="fa-angle-right"></i></div>
	                    <div class="swiper-pagination"></div>
	               </div>';
        return '

<style>.blox-logos img {width:auto !important; margin:0 auto; display:inline-block; vertical-align:middle;}</style>
		<div class="blox-element blox-logos ' . $extra_class . '" data-animate="' . $animation . '">
					' . $title . $result . '
		        </div>';
    }
    return '';
}
Ejemplo n.º 6
0
function blox_blog_row_parse_hook($atts)
{
    extract(shortcode_atts(array('categories' => '', 'column' => '4', 'count' => '8', 'bgcolor' => '#34495e', 'ratio' => '4x3', 'filter' => '1', 'order' => '', 'exclude' => '', 'extra_class' => '', 'visibility' => ''), $atts));
    $visibility = str_replace(',', ' ', $visibility);
    global $query, $post, $paged;
    $temp_qry = $query;
    $temp_post = $post;
    wp_reset_query();
    wp_reset_postdata();
    /* Build queries
       ================================================*/
    $args = array('post__not_in' => explode(',', $exclude), 'posts_per_page' => (int) $count);
    if ($categories != '') {
        $args['cat'] = explode(',', $categories);
    }
    if ($order == 'dateasc') {
        $args['orderby'] = 'date';
        $args['order'] = 'ASC';
    } elseif ($order == 'titleasc') {
        $args['orderby'] = 'title';
        $args['order'] = 'ASC';
    } elseif ($order == 'titledes') {
        $args['orderby'] = 'title';
        $args['order'] = 'DESC';
    } elseif ($order == 'comment') {
        $args['orderby'] = 'comment_count';
    } elseif ($order == 'postid') {
        $args['orderby'] = 'ID';
    } elseif ($order == 'random') {
        $args['orderby'] = 'rand';
        add_action('posts_orderby', 'edit_posts_orderby');
    }
    $result = '';
    $query = new WP_Query($args);
    if ($query->have_posts()) {
        $cats_filter = array();
        $item_number = 0;
        while ($query->have_posts()) {
            $query->the_post();
            $item_number++;
            $image_width = 539;
            $current_filter_classes = '';
            $terms = wp_get_post_categories(get_the_ID());
            foreach ($terms as $term) {
                $term = get_category($term);
                $current_filter_classes .= 'filter-' . $term->slug . ' ';
                $temp_cat = array('id' => $term->term_id, 'title' => $term->name, 'slug' => $term->slug);
                if (!in_array($temp_cat, $cats_filter)) {
                    $cats_filter[] = $temp_cat;
                }
            }
            $thumb = '';
            if (has_post_thumbnail(get_the_ID())) {
                $fimage = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
                $thumb = $fimage[0];
            } else {
                $gallery_field = tt_getmeta('blog_gallery');
                $gimages = explode(',', $gallery_field);
                if (isset($gimages[0]) && $gimages[0] != '') {
                    $thumb = wp_get_attachment_url($gimages[0]);
                    $thumb = $thumb !== false ? $thumb : THEME_NOIMAGE;
                }
            }
            $iwidth = 600;
            $iheight = 450;
            if ($ratio == '1x1') {
                $iwidth = 600;
                $iheight = 600;
            } else {
                if ($ratio == '16x9') {
                    $iwidth = 600;
                    $iheight = 337;
                }
            }
            $thumb = $thumb != '' ? blox_aq_resize($thumb, $iwidth, $iheight, true) : '';
            $folio_arg = array('item_style' => 'alternative', 'thumb' => $thumb, 'class' => ' ' . $current_filter_classes);
            $result .= blox_loop_portfolio($folio_arg);
        }
        $filter_html = '';
        if ($filter == '1') {
            $cat_filter_html = '';
            foreach ($cats_filter as $cat) {
                $cat_filter_html .= '<li><a href="javascript:;" title="' . $cat['title'] . '" data-filter="filter-' . $cat['slug'] . '">' . $cat['title'] . '</a></li>';
            }
            if ($cat_filter_html != '') {
                $filter_html = '<div class="row">
                                    <div class="col-md-12">
                                        <div class="portfolio-filter">
                                            <div class="pull-left">
                                                <h3>' . __('All', 'themeton') . '</h3>
                                            </div>
                                            <div class="pull-right">
                                                <ul class="nav nav-pills">
                                                    <li class="dropdown active">
                                                        <a class="dropdown-toggle navInst" data-toggle="dropdown" href="#">
                                                            ' . __('Sort Blog', 'themeton') . ' <span class="caret"></span>
                                                        </a>
                                                        <ul class="dropdown-menu" role="menu">
                                                            <li><a href="javascript:;" title="All" data-filter="all" class="active">' . __('All', 'themeton') . '</a></li>
                                                            <li class="divider"></li>
                                                            ' . $cat_filter_html . '
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="clearfix"></div>
                                        </div>
                                    </div>
                                </div>';
            }
        }
        // Grid container
        $masonry_class = '';
        $result = '<div class="blox-element grid-loop blog fullwidth-portfolio ' . $extra_class . ' ' . $visibility . '" style="opacity:0;" data-column="' . $column . '">
                        ' . $filter_html . '
                        <div class="row masonry-container" style="background-color:' . $bgcolor . ';">' . $result . '</div>
                        <div class="clearfix"></div>
                    </div>';
    }
    wp_reset_query();
    wp_reset_postdata();
    $query = $temp_qry;
    $post = $temp_post;
    return $result;
}
Ejemplo n.º 7
0
function blox_parse_carousel_hook($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'post_type' => 'post', 'category' => '0', 'count' => '6', 'item_style' => 'default', 'overlay' => 'none', 'slideseconds' => 0, 'animation' => '', 'extra_class' => '', 'skin' => '', 'visibility' => ''), $atts));
    $visibility = str_replace(',', ' ', $visibility);
    $extra_class = $extra_class . ' ' . $visibility;
    global $post, $product, $woocommerce, $woocommerce_loop;
    global $the_query;
    $temp_post = $post;
    $temp_query = $the_query;
    $args = array('post_type' => $post_type, 'posts_per_page' => (int) $count, 'ignore_sticky_posts' => 1);
    if ($category != '' && $category != '0') {
        $taxonomies = get_object_taxonomies($post_type);
        $args['tax_query'] = array(array('taxonomy' => $taxonomies[0], 'terms' => $category));
    }
    $i = 0;
    $html = '';
    $title = $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : '';
    $the_query = new WP_Query($args);
    while ($the_query->have_posts()) {
        $the_query->the_post();
        if ($post_type == 'product') {
            $product = get_product(get_the_Id());
            ob_start();
            woocommerce_get_template_part('content', 'product');
            $html .= ob_get_clean();
        } else {
            $thumb = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
            $image = $thumb != '' ? blox_aq_resize($thumb, 400, 300, true) : '';
            $i++;
            $folio_arg = array('item_style' => $item_style, 'overlay' => $overlay, 'thumb' => $image, 'class' => 'col-md-3 col-sm-6 col-xs-12 swiper-slide', 'width' => '400', 'height' => '300');
            $html .= blox_loop_portfolio($folio_arg);
        }
    }
    $the_query = $temp_query;
    $post = $temp_post;
    $autoplay = 'data-duration="' . (int) $slideseconds * 1000 . '"';
    if ($post_type == 'product') {
        return "<div class='blox-element blox-carousel woocommerce swiper-container' {$autoplay}>\n                    {$title}\n                    <ul class='blox-element products swiper-wrapper'>\n                        " . $html . "\n                    </ul>\n                    <div class='carousel-control-prev'><i class='fa-angle-left'></i></div>\n                    <div class='carousel-control-next'><i class='fa-angle-right'></i></div>\n                </div>";
    }
    $skin = $item_style != 'alternative' ? $skin : '';
    return "<div class='blox-element blox-carousel swiper-container {$extra_class}' {$autoplay}>\n                {$title}\n                <div class='blox-element grid-loop portfolio swiper-wrapper {$skin}'>\n                    " . $html . "\n                </div>\n                <div class='carousel-control-prev'><i class='fa-angle-left'></i></div>\n                <div class='carousel-control-next'><i class='fa-angle-right'></i></div>\n            </div>";
}
Ejemplo n.º 8
0
function blox_portfolio_gallery($options)
{
    $options = array_merge(array('width' => '', 'height' => ''), $options);
    global $post;
    $gallery_field = tt_getmeta('portfolio_gallery');
    $images = explode(',', $gallery_field);
    $html = '';
    foreach ($images as $id) {
        $alt = 'Portfolio gallery image';
        if ((int) $id > 0) {
            $attach_url = wp_get_attachment_url($id);
            $attach_url = $attach_url !== false ? $attach_url : THEME_NOIMAGE;
            $alt = get_post_meta($id, '_wp_attachment_image_alt', true);
            $img = blox_aq_resize($attach_url, 600, 350, true);
            $img = $options['height'] != '' && $options['height'] != '0' ? blox_aq_resize($attach_url, $options['width'], $options['height'], true) : $img;
            $html .= '<div class="swiper-slide">
                        <img itemprop="image" src="' . $img . '" alt="' . $alt . '" class="portfolio-image" />
                      </div>';
        }
    }
    return '<div class="entry-media">
                <div class="swiper-container swipy-slider">
                    <div class="swiper-wrapper">' . $html . '</div>
                    <div class="swiper-control-prev"><i class="fa fa-angle-left"></i></div>
                    <div class="swiper-control-next"><i class="fa fa-angle-right"></i></div>
                    <div class="swiper-pagination"></div>
                </div>
            </div>';
}
Ejemplo n.º 9
0
function blox_parse_carouselrow_hook($atts, $content = null)
{
    extract(shortcode_atts(array('post_type' => 'post', 'category' => '0', 'count' => '6', 'slideseconds' => 5, 'ratio' => '1x1', 'extra_class' => '', 'visibility' => ''), $atts));
    $visibility = str_replace(',', ' ', $visibility);
    $extra_class = $extra_class . ' ' . $visibility;
    global $post, $product, $woocommerce, $woocommerce_loop;
    global $the_query;
    $temp_post = $post;
    $temp_query = $the_query;
    $args = array('post_type' => $post_type, 'posts_per_page' => (int) $count, 'ignore_sticky_posts' => 1);
    if ($category != '' && $category != '0') {
        $taxonomies = get_object_taxonomies($post_type);
        $args['tax_query'] = array(array('taxonomy' => $taxonomies[0], 'terms' => $category));
    }
    $i = 0;
    $html = '';
    $the_query = new WP_Query($args);
    while ($the_query->have_posts()) {
        $the_query->the_post();
        $thumb = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        //$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
        //$thumb = $image[0];
        $iwidth = 600;
        $iheight = 450;
        if ($ratio == '1x1') {
            $iwidth = 600;
            $iheight = 600;
        } else {
            if ($ratio == '16x9') {
                $iwidth = 600;
                $iheight = 337;
            }
        }
        $thumb = $thumb != '' ? blox_aq_resize($thumb, $iwidth, $iheight, true) : '';
        $folio_arg = array('item_style' => 'alternative', 'overlay' => '', 'thumb' => $thumb, 'class' => 'swiper-slide');
        $html .= blox_loop_portfolio($folio_arg);
    }
    $the_query = $temp_query;
    $post = $temp_post;
    $autoplay = 'data-duration="' . (int) $slideseconds * 1000 . '"';
    return "<div class='fullwidth-carousel swiper-container {$extra_class}' style='opacity:0;' {$autoplay}>\n                <div class='blox-element grid-loop portfolio swiper-wrapper'>\n                    " . $html . "\n                </div>\n            </div>";
}
Ejemplo n.º 10
0
function blox_portfolio_parse_hook($atts)
{
    extract(shortcode_atts(array('title' => '', 'style' => 'default', 'categories' => '', 'count' => '5', 'pager' => '0', 'height' => '', 'readmore' => __('Read more', 'themeton'), 'ignoresticky' => 'yes', 'filter' => '1', 'content_type' => 'default', 'overlay' => 'none', 'exclude' => '', 'order' => '', 'extra_class' => '', 'element_style' => 'default', 'skin' => '', 'visibility' => ''), $atts));
    $visibility = str_replace(',', ' ', $visibility);
    global $query, $post, $paged;
    $temp_qry = $query;
    $temp_post = $post;
    wp_reset_query();
    wp_reset_postdata();
    if (is_front_page()) {
        $paged = get_query_var('page') ? get_query_var('page') : 1;
    }
    /* Build queries
       ================================================*/
    $args = array('post_type' => 'portfolio', 'post__not_in' => explode(',', $exclude), 'posts_per_page' => (int) $count, 'paged' => $paged, 'ignore_sticky_posts' => $ignoresticky == 'yes' ? 1 : 0);
    $cats_filter = array();
    if ($categories != '') {
        $format_array = explode(',', $categories);
        $args['tax_query'] = array(array('taxonomy' => 'portfolio_entries', 'field' => 'id', 'terms' => $format_array));
        foreach ($format_array as $term) {
            $the_term = get_term($term, 'portfolio_entries');
            $temp_cat = array('id' => $the_term->term_id, 'title' => $the_term->name, 'slug' => $the_term->slug);
            if (!in_array($temp_cat, $cats_filter)) {
                $cats_filter[] = $temp_cat;
            }
        }
    }
    if ($order == 'dateasc') {
        $args['orderby'] = 'date';
        $args['order'] = 'ASC';
    } elseif ($order == 'titleasc') {
        $args['orderby'] = 'title';
        $args['order'] = 'ASC';
    } elseif ($order == 'titledes') {
        $args['orderby'] = 'title';
        $args['order'] = 'DESC';
    } elseif ($order == 'comment') {
        $args['orderby'] = 'comment_count';
    } elseif ($order == 'postid') {
        $args['orderby'] = 'ID';
    } elseif ($order == 'random') {
        $args['orderby'] = 'rand';
        add_action('posts_orderby', 'edit_posts_orderby');
    }
    $result = '';
    $title = $title != '' ? '<h3 class="element-title">' . $title . '</h3>' : '';
    $query = new WP_Query($args);
    if ($query->have_posts()) {
        $item_number = 0;
        while ($query->have_posts()) {
            $query->the_post();
            // If it is grid style, there don't need image scaled cropping
            $image_height = 0;
            if (strpos($style, 'grid') !== false) {
                $image_height = $height != '' ? (int) $height : 0;
            }
            $item_number++;
            $class = 'col-md-3 col-sm-6 col-xs-12';
            $image_width = 539;
            if ($style == 'masonry3' || $style == 'grid3') {
                $class = 'col-md-4 col-sm-6 col-xs-12';
                $image_width = 344;
            } else {
                if ($style == 'masonry4' || $style == 'grid4') {
                    $class = 'col-md-3 col-sm-6 col-xs-12';
                    $image_width = 247;
                } else {
                    if ($style == 'masonry2' || $style == 'grid2') {
                        $class = 'col-md-6 col-sm-6 col-xs-12';
                        $image_width = 0;
                    }
                }
            }
            // If it is centered style, there don't need image overlay
            if ($style == 'centered') {
                $overlay = 'nothing';
            }
            $current_filter_classes = '';
            $terms = wp_get_post_terms(get_the_ID(), 'portfolio_entries');
            foreach ($terms as $term) {
                $current_filter_classes .= 'filter-' . $term->slug . ' ';
                if (empty($format_array)) {
                    $temp_cat = array('id' => $term->term_id, 'title' => $term->name, 'slug' => $term->slug);
                    if (!in_array($temp_cat, $cats_filter)) {
                        $cats_filter[] = $temp_cat;
                    }
                }
            }
            $thumb = '';
            if (has_post_thumbnail(get_the_ID())) {
                $fimage = wp_get_attachment_url(get_post_thumbnail_id(get_the_ID()));
                $thumb = $fimage !== false ? $fimage : THEME_NOIMAGE;
            } else {
                $gallery_field = tt_getmeta('portfolio_gallery');
                $gimages = explode(',', $gallery_field);
                if (isset($gimages[0]) && $gimages[0] != '') {
                    $thumb = wp_get_attachment_url($gimages[0]);
                    $thumb = $thumb !== false ? $thumb : THEME_NOIMAGE;
                }
            }
            $cols = (int) str_replace('grid', '', str_replace('masonry', '', $style));
            $img_w = 520;
            $img_w = $cols == 3 ? 337 : $img_w;
            $img_w = $cols == 4 ? 245 : $img_w;
            $height = $height != '' ? $height : '0';
            $thumb = $thumb != '' ? blox_aq_resize($thumb, $img_w, $height, true) : '';
            $folio_arg = array('item_style' => $content_type, 'overlay' => $overlay, 'thumb' => $thumb, 'class' => $class . ' ' . $current_filter_classes, 'width' => $img_w, 'height' => $height);
            $result .= blox_loop_portfolio($folio_arg);
        }
        $pager_html = '';
        if ($pager == '1') {
            ob_start();
            themeton_pager($query);
            $pager_html .= ob_get_contents();
            ob_end_clean();
        }
        $filter_html = '';
        if ($filter == '1') {
            $cat_filter_html = '';
            foreach ($cats_filter as $cat) {
                $cat_filter_html .= '<li><a href="javascript:;" title="' . $cat['title'] . '" data-filter="filter-' . $cat['slug'] . '">' . $cat['title'] . '</a></li>';
            }
            if ($cat_filter_html != '') {
                $filter_html = '<div class="row">
                                    <div class="col-md-12">
                                        <div class="portfolio-filter">
                                            <div class="pull-left">
                                                <h3>' . __('All', 'themeton') . '</h3>
                                            </div>
                                            <div class="pull-right">
                                                <ul class="nav nav-pills">
                                                    <li class="dropdown active">
                                                        <a class="dropdown-toggle navInst" data-toggle="dropdown" href="#">
                                                            ' . __('Sort Portfolio', 'themeton') . ' <span class="caret"></span>
                                                        </a>
                                                        <ul class="dropdown-menu" role="menu">
                                                            <li><a href="javascript:;" title="All" data-filter="all" class="active">' . __('All', 'themeton') . '</a></li>
                                                            <li class="divider"></li>
                                                            ' . $cat_filter_html . '
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="clearfix"></div>
                                        </div>
                                    </div>
                                </div>';
            }
        }
        // Grid container
        $masonry_class = '';
        if (strpos($style, 'masonry') !== false) {
            $masonry_class = 'portfolio-masonry';
        }
        $result = '<div class="blox-element grid-loop portfolio ' . $element_style . ' ' . $masonry_class . ' ' . $extra_class . ' ' . $visibility . '">
                        ' . $filter_html . '
                        <div class="row masonry-container">' . $result . '</div>
                        ' . $pager_html . '
                    </div>';
    }
    wp_reset_query();
    wp_reset_postdata();
    $query = $temp_qry;
    $post = $temp_post;
    return $result;
}