Example #1
0
function get_page_builder_items()
{
    global $post;
    $items = array('stpb_accordion' => array('title' => __('Accordions', 'smooththemes'), 'default_with' => '1_2', 'generate_func' => 'stpb_accordion_generate'), 'stpb_toggle' => array('title' => __('Toggle', 'smooththemes'), 'default_with' => '1_2', 'generate_func' => 'stpb_toggle_generate'), 'stpb_tabs' => array('title' => 'Tabs', 'default_with' => '1_2', 'generate_func' => 'stpb_tabs_generate'), 'stpb_banner' => array('title' => __('Banner', 'smooththemes'), 'generate_func' => 'stpb_banner_generate', 'default_with' => '1_3'), 'stpb_text' => array('title' => 'Text', 'generate_func' => 'stpb_text_generate'), 'stpb_clients' => array('title' => 'Clients', 'generate_func' => 'stpb_clients_generate'), 'stpb_testimonials' => array('title' => 'Testimonials', 'generate_func' => 'stpb_testimonials_generate'), 'stpb_post_gallery' => array('title' => __('Gallery', 'smooththemes'), 'generate_func' => 'stpb_post_gallery_generate'), 'stpb_service' => array('title' => 'Service Column', 'default_with' => '1_3', 'block' => false, 'generate_func' => 'stpb_text_generate'), 'stpb_alert' => array('title' => __('Alert', 'smooththemes'), 'block' => false, 'generate_func' => 'stpb_alert_generate'), 'stpb_portfolio' => array('title' => __('Portfolio', 'smooththemes'), 'block' => false, 'generate_func' => 'stpb_portfolio_generate'), 'stpb_rooms' => array('title' => __('Rooms', 'smooththemes'), 'block' => false, 'generate_func' => 'stpb_rooms_generate'), 'stpb_events' => array('title' => __('Events', 'smooththemes'), 'block' => false, 'generate_func' => 'stpb_events_generate'), 'stpb_upcomming_events' => array('title' => __('Upcoming events', 'smooththemes'), 'block' => false, 'generate_func' => 'stpb_upcomming_events_generate'), 'stpb_events_calendar' => array('title' => __('Events Calenadar', 'smooththemes'), 'generate_func' => 'stpb_events_calendar_generate'), 'stpb_contact_form' => array('title' => __('Contact form', 'smooththemes'), 'generate_func' => 'stpb_contact_form_generate'), 'stpb_reservation_form' => array('title' => __('Reservation form', 'smooththemes'), 'generate_func' => 'stpb_reservation_form_generate'));
    if ($post->post_type == 'page') {
        $items['stpb_blog'] = array('title' => 'Blog Posts', 'generate_func' => 'stpb_blog_generate');
        $items['stpb_this_entry'] = array('title' => __('This Page entry', 'smooththemes'), 'editable' => false, 'generate_func' => 'stpb_this_entry_generate');
    }
    //woocommerce plugin
    if (st_is_woocommerce()) {
        $items['stpb_WooCommerce_products'] = array('title' => __('WooCommerce Products', 'smooththemes'), 'generate_func' => 'stpb_WooCommerce_products_generate');
    }
    return apply_filters('get_page_builder_items', $items);
}
Example #2
0
 function st_enqueue_styles()
 {
     if (!is_admin()) {
         //Register styles
         wp_enqueue_style('st_style', get_bloginfo('stylesheet_url'), false, ST_VERSION);
         wp_enqueue_style('flexslider', st_css('flexslider.css'), false);
         wp_enqueue_style('font-awesome', st_css('font-awesome.min.css'));
         wp_enqueue_style('flexslider', st_css('flexslider.css'));
         wp_enqueue_style('responsive', st_css('responsive.css'));
         wp_enqueue_style('prettyPhoto', st_css('prettyPhoto.css'));
         if (st_is_woocommerce()) {
             wp_enqueue_style('woocommerce_frontend_styles', st_css('woocommerce.css'));
         }
     }
 }
Example #3
0
 function ST_Page_Builder_Items_Config()
 {
     $items = array('stpb_widget' => array('title' => __('Sidebar', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_widget.png", 'tooltip' => __('Add a widget sidebar', 'smooththemes'), 'generate_func' => 'stpb_generate_widget'), 'stpb_text' => array('title' => __('Text', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_text.png", 'tooltip' => __('Add a custom text block', 'smooththemes'), 'generate_func' => 'stpb_generate_text', 'shortcode' => false, 'preview' => true), 'stpb_heading' => array('title' => __('Heading', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_heading.png", 'generate_func' => 'stpb_generate_heading', 'tooltip' => __('Add a Heading', 'smooththemes'), 'preview' => true), 'stpb_tabs' => array('title' => __('Tabs', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_tab.png", 'tooltip' => __('Add Tabs Block', 'smooththemes'), 'generate_func' => 'stpb_generate_tabs'), 'stpb_toggle' => array('title' => __('Toggle', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_accordion.png", 'tooltip' => __('Add Toggle block', 'smooththemes'), 'generate_func' => 'stpb_generate_toggle'), 'stpb_accordion' => array('title' => __('Accordion', 'smooththemes'), 'tooltip' => __('Add Accordion block', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_accordion.png", 'generate_func' => 'stpb_generate_accordion'), 'stpb_testimonials' => array('title' => __('Testimonials', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_testimonial.png", 'tooltip' => __('Add Testimonials block', 'smooththemes'), 'generate_func' => 'stpb_generate_testimonials'), 'stpb_notification' => array('title' => __('Notification', 'smooththemes'), 'tooltip' => __('Add a Notification block', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_notification.png", 'generate_func' => 'stpb_generate_notification', 'preview' => true), 'stpb_divider' => array('title' => __('Divider', 'smooththemes'), 'tooltip' => __('Add Divider', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_divider.png", 'generate_func' => 'stpb_generate_divider'), 'stpb_clients' => array('title' => __('Clients', 'smooththemes'), 'tooltip' => __('Add Clients block', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_client.png", 'generate_func' => 'stpb_generate_clients'), 'stpb_team_member' => array('title' => __('Team Member', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_client.png", 'tooltip' => __('Team member', 'smooththemes'), 'tab' => 'content', 'generate_func' => 'stpb_generate_team_member'), 'stpb_icon_list' => array('title' => __('Custom List', 'smooththemes'), 'tooltip' => __('Add Custom List', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_list.png", 'generate_func' => 'stpb_generate_icon_list'), 'stpb_button' => array('title' => __('Button', 'smooththemes'), 'tooltip' => __('Add a Button', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_button.png", 'generate_func' => 'stpb_generate_button', 'preview' => true), 'stpb_table' => array('title' => __('Table Data', 'smooththemes'), 'tooltip' => __('Add a Table', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_table.png", 'generate_func' => 'stpb_generate_table', 'shortcode' => true), 'stpb_table_price' => array('title' => __('Pricing Box', 'smooththemes'), 'tooltip' => __('Add a Pricing Box', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_table.png", 'generate_func' => 'stpb_generate_table_price', 'shortcode' => true), 'stpb_iconbox' => array('title' => __('Icon Box', 'smooththemes'), 'tooltip' => __('Add a Icon box', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_iconbox.png", 'generate_func' => 'stpb_generate_iconbox', 'preview' => true), 'stpb_gallery' => array('title' => __('Simple Gallery', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_simple_gallery.png", 'tab' => 'media', 'tooltip' => __('Add Simple Gallery block', 'smooththemes'), 'generate_func' => 'stpb_generate_gallery', 'preview' => true), 'stpb_image' => array('title' => __('Image', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_image.png", 'tab' => 'media', 'tooltip' => __('Add a Image', 'smooththemes'), 'generate_func' => 'stpb_generate_image', 'preview' => true), 'stpb_video' => array('title' => __('Video', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_video.png", 'tab' => 'media', 'tooltip' => __('Add a Video', 'smooththemes'), 'generate_func' => 'stpb_generate_video', 'preview' => true), 'stpb_slider' => array('title' => __('Slider', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_carousel.png", 'tab' => 'media', 'tooltip' => __('Add a Slider', 'smooththemes'), 'generate_func' => 'stpb_generate_slider', 'preview' => false), 'stpb_blog' => array('title' => __('Blog', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_blog.png", 'tooltip' => __('Add Blog Item', 'smooththemes'), 'tab' => 'post', 'generate_func' => 'stpb_generate_blog'), 'stpb_login' => array('title' => __('Login', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_user_login.png", 'tooltip' => __('Add a Login form', 'smooththemes'), 'generate_func' => 'stpb_generate_login'), 'stpb_register' => array('title' => __('Register', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_user_login.png", 'tooltip' => __('Add a Register form', 'smooththemes'), 'generate_func' => 'stpb_generate_register'), 'stpb_profile' => array('title' => __('Profile', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_profile.png", 'tooltip' => __('Add a Profile form', 'smooththemes'), 'generate_func' => 'stpb_generate_profile'), 'stpb_lost_password' => array('title' => __('Lost Password', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_user_login.png", 'tooltip' => __('Add a Lost Password form', 'smooththemes'), 'generate_func' => 'stpb_generate_lost_password'), 'stpb_contact_form' => array('title' => __('Contact From', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_user_login.png", 'tooltip' => __('Add a Contact form', 'smooththemes'), 'generate_func' => 'stpb_generate_contact_form'), 'stpb_chart' => array('title' => __('Chart', 'smooththemes'), 'icon' => "", 'tooltip' => __('Add a percentage chart', 'smooththemes'), 'generate_func' => 'stpb_generate_chart'), 'stpb_progress_bars' => array('title' => __('Progress bars', 'smooththemes'), 'icon' => "", 'tooltip' => __('Add progress bars', 'smooththemes'), 'generate_func' => 'stpb_generate_progress_bars'), 'stpb_count_to' => array('title' => __('CountTo', 'smooththemes'), 'icon' => "", 'tooltip' => __('Add a CountTo box', 'smooththemes'), 'generate_func' => 'stpb_generate_count_to'));
     if (st_is_woocommerce()) {
         $items['stpb_wc_products'] = array('title' => __('WC Products', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_woocommerce.png", 'tooltip' => __('WooCommerce Products', 'smooththemes'), 'tab' => 'post', 'generate_func' => 'stpb_generate_wc_products');
     }
     // if contact form 7 actived
     if (is_plugin_active('contact-form-7/wp-contact-form-7.php')) {
         //$icon = plugins_url().'/contact-form-7/admin/images/screen-icon.png';
         $items['stpb_contact_from_7'] = array('title' => __('Contact Form 7', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_contactform7.png", 'tab' => 'post', 'tooltip' => __('Add a Contact From 7', 'smooththemes'), 'generate_func' => 'stpb_generate_contact_from_7');
     }
     // if LayerSlider actived
     if (is_plugin_active('LayerSlider/layerslider.php')) {
         //$icon = plugins_url().'/LayerSlider/img/icon_16x16.png';
         $items['stpb_LayerSlider'] = array('title' => __('LayerSlider', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_layerslider.png", 'tab' => 'media', 'tooltip' => __('Add a LayerSlider', 'smooththemes'), 'generate_func' => 'stpb_generate_LayerSlider');
     }
     // if revslider. actived
     if (is_plugin_active('revslider/revslider.php')) {
         //$icon = plugins_url().'/LayerSlider/img/icon_16x16.png';
         $items['stpb_revslider'] = array('title' => __('Revolution', 'smooththemes'), 'icon' => ST_PAGEBUILDER_URL . "assets/images/builder_carousel.png", 'tab' => 'media', 'tooltip' => __('Add a Revolution Slider', 'smooththemes'), 'generate_func' => 'stpb_generate_revslider');
     }
     return apply_filters('stpb_list_items', $items);
 }
Example #4
0
    require_once ST_TEMPLATE_DIR . '/template-functions.php';
}
if (is_file(ST_TEMPLATE_DIR . '/shop-template-functions.php')) {
    require_once ST_TEMPLATE_DIR . '/shop-template-functions.php';
}
require_once ST_LIB_DIR . 'events-calendar.php';
require_once ST_LIB_DIR . 'shortcode.php';
// load ajax
require_once ST_LIB_DIR . 'st-ajax.php';
// defbug screen
if (defined('ST_DEBUG') && ST_DEBUG === true) {
    if (is_file(ST_LIB_DIR . 'debug.php')) {
        include_once ST_LIB_DIR . 'debug.php';
    }
}
if (st_is_woocommerce()) {
    require_once ST_LIB_DIR . 'wc-product-cat-walker.php';
    require_once ST_WC_TEMPLATE_DIR . 'st-wc-functions.php';
}
/*   Include Theme Plugins    */
require_once ST_LIB_DIR . 'st-install-plugins.php';
require_once ST_LIB_DIR . 'st-active-theme.php';
require_once ST_DIR . '/css/css.php';
require_once ST_DIR . '/importer/init.php';
/**
 * Automatic theme updates notifications
 */
if (!function_exists('st_theme_updater')) {
    function st_theme_updater()
    {
        $username = trim(st_get_setting('tf_username'));
Example #5
0
function st_builder_meta_shop($name = '', $values = array(), $post = false)
{
    if (get_option('woocommerce_shop_page_id') != $post->ID || !$post->ID > 0 || !st_is_woocommerce()) {
        return;
    }
    ?>
      <?php 
    if ($no_value) {
        $values['show_product_slider'] = '';
    }
    ?>
            
         <div class="stdive"></div>
         <?php 
    stpb_select_layout($name, 'shop_tax_layout', 'shop_tax_left_sb', 'shop_tax_right_sb', $values, __('Product Categories/Tags layout', 'smooththemes'));
    ?>
            

        <div class="stdive"></div>
         <?php 
    stpb_select_layout($name, 'shop_single_layout', 'shop_single_left_sb', 'shop_single_right_sb', $values, __('Single product layout', 'smooththemes'));
    ?>
            
        
    <?php 
}
Example #6
0
function st_woocommerce_shortcode_products($args, $content = '')
{
    if (!st_is_woocommerce()) {
        return '';
    }
    global $wp_query, $woocommerce;
    global $post, $paged;
    $tmp_post = $post;
    //   echo var_dump($args); die();
    extract(shortcode_atts(array('title' => 0, 'cats' => array(), 'numpost' => 3, 'exclude' => '', 'orderby' => 'ID', 'order' => 'DESC', 'pbwith' => '1_1', 'type' => 1, 'site_layout' => '', 'show_title' => 'n', 'more_text' => '', 'more_url' => '', 'show_paging' => 'n', 'num_col' => 3), $args));
    $wc = $pbwith;
    $w = explode('_', $wc);
    $t = intval($w[0]);
    $m = intval($w[1]);
    if ($m > 0 and $t > 0) {
        $c = $t / $m;
    } else {
        $c = 1;
    }
    $html = $cat_link = $cat_title = '';
    // just only for one cate
    if (is_string($cats)) {
        $cats = explode(',', $cats);
    }
    $cats = $cats[0];
    /*
    if($cats>0){
        $cat_link = get_category_link($cats);
        $cat_title = get_cat_name($cats);
    }else{
        // do some thing
    }
    */
    if ($show_title == 'y' and $title != '') {
        $html = '
                <div class="builder-title-wrapper clearfix">
                    <h3 class="builder-item-title">' . esc_html($title) . '</h3>';
        if ($more_text != '') {
            $html .= '<a href="' . ($more_url != '' ? esc_url($more_url) : '#') . '" class="view-all">' . esc_html($more_text) . '</a>';
        }
        $html .= '</div>';
    }
    if (intval($numpost) <= 0) {
        $numpost = (int) get_option('posts_per_page', 10);
    } else {
        $numpost = intval($numpost);
    }
    $args = array('posts_per_page' => $numpost);
    if ($cats > 0) {
        $args['tax_query'] = array('relation' => 'AND', array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => array($cats), 'operator' => 'IN'));
    }
    if ($exclude != '') {
        $exclude = explode(',', $exclude);
    }
    $args['post__not_in'] = $exclude;
    // custom order by meta key
    if (isset($orderby[0]) && $orderby[0] == '_') {
        $orderby = substr($orderby, 1);
        $args['meta_key'] = $orderby;
        $args['orderby'] = 'meta_value_num';
        $args['meta_query'] = array();
        if (isset($args['hide_free']) && 1 == $args['hide_free']) {
            $args['meta_query'][] = array('key' => '_price', 'value' => 0, 'compare' => '>', 'type' => 'DECIMAL');
        }
        $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
        $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
    } else {
        $args['orderby'] = $orderby;
    }
    $args['order'] = $order;
    if ($paged > 0) {
        $args['paged'] = $paged;
    } else {
        $paged = isset($_REQUEST['paged']) ? intval($_REQUEST['paged']) : 1;
    }
    $args['post_type'] = 'product';
    $args['post_status'] = 'publish';
    if (st_is_wpml()) {
        $args['sippress_filters'] = true;
        $args['language'] = get_bloginfo('language');
    }
    //  echo var_dump($args); die();
    $new_query = new WP_Query($args);
    $myposts = $new_query->posts;
    $i = 0;
    $e = '';
    ob_start();
    $old_content = ob_get_clean();
    if ($type == 3 && count($myposts) % 2 != 0) {
        $myposts[] = false;
    }
    if ($site_layout == 1 && ($pbwith == '1_1' || $pbwith == '3_4') && $type != 3) {
        $image_size = 'st_large';
    }
    // show columns
    $num_col = intval($num_col);
    $num_col = $num_col > 0 && $num_col <= 4 ? $num_col : 4;
    // echo $num_col; die();
    global $woocommerce_loop;
    $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', $num_col);
    foreach ($myposts as $post) {
        setup_postdata($post);
        global $product;
        $tpl = '';
        ob_start();
        woocommerce_get_template_part('content', 'product');
        $tpl = ob_get_clean();
        // $e.='<div class="product">'.$e.=.'</div>';
        $e .= $tpl;
        $i++;
    }
    $html .= $e;
    $html = '<ul class="products">' . $html . '</ul>';
    $p = '';
    if (!is_home() && !is_front_page()) {
        // only true if not is home page or front page
        if ($show_paging == 'y') {
            $p = st_post_pagination($new_query->max_num_pages, 2, false);
            if ($p != '') {
                $p = '<div class="pagination text-center t0">' . $p . '</div>';
            }
        }
    }
    wp_reset_postdata();
    echo $old_content;
    return '<div class="woocommerce-wrap woocommerce  builder-item-wrapper">' . do_shortcode($html) . $p . '</div>';
}
Example #7
0
function st_theme_font()
{
    $font_body = st_get_setting("body_font", array('font-family' => 'Roboto'));
    $heading_font = st_get_setting("headings_font", array('font-family' => 'Roboto'));
    st_make_font_style($font_body, 'body');
    st_make_font_style($heading_font, 'h1,h2,h3,h4,h5,h6, .subscribe_section label, .widget_calendar  caption');
    // Predefined Colors (pc) - Custom Color (cc)
    $pc = st_get_setting("predefined_colors");
    $e_cc = st_get_setting("enable_custom_global_skin");
    $cc = st_get_setting("custom_global_skin");
    $skin = '';
    if ($e_cc == 'y') {
        $skin = $cc != '' ? $cc : $pc;
    } elseif ($pc != '') {
        $skin = $pc;
    }
    $skin = str_replace('#', '', esc_attr($skin));
    $skin = $skin != '' ? $skin : 'bca474';
    ?>
    
<style type="text/css">
/* CSS Skin */
a,.primary-nav ul li.current-menu-item a,.top-bar-right a:hover,.primary-nav ul li a:hover,.cpt-filters li a:hover,.cpt-filters li a.selected,
.blog-title a:hover,.sidebar .widget_nav_menu ul li a:hover,
.sidebar .widget_nav_menu ul li.current-menu-item a,.st-recent-posts ul li a:hover,.st-recent-posts .recent-date,.footer-social li a:hover,
.tab-title li.current,  .cpt-detail .cpt-title
{	
    color:#<?php 
    echo $skin;
    ?>
;
    -o-transition:.5s;
    -ms-transition:.5s;
    -moz-transition:.5s;
    -webkit-transition:.5s;

}

input[type="reset"], input[type="submit"], input[type="button"], button,.footer-social li a:hover,.btn_default,.acc-title-active,.toggle_current,
.st-pagination li a:hover,.ui-datepicker-calendar .ui-state-hover,.ui-datepicker-calendar .ui-state-active,.go-detail,.go-gallery,
.color ,  .st-pagination li a.page-current,   .st-pagination  li .page-numbers.current , table#wp-calendar thead > tr > th,  table#wp-calendar td#today,
.bg_color:hover,
.woocommerce div.product form.cart .button, .woocommerce #content div.product form.cart .button, .woocommerce-page div.product form.cart .button, .woocommerce-page #content div.product form.cart .button,
.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt {
        background-color: #<?php 
    echo $skin;
    ?>
; 
        -o-transition:.5s;
        -ms-transition:.5s;
        -moz-transition:.5s;
        -webkit-transition:.5s;
}
  
<?php 
    if (st_is_woocommerce()) {
        ?>
 .woocommerce .widget_price_filter .ui-slider .ui-slider-handle, .woocommerce-page .widget_price_filter .ui-slider .ui-slider-handle
    {	background: #<?php 
        echo $skin;
        ?>
;  }
<?php 
    }
    ?>
  
.flickr_badge_image img:hover, .footer-sidebar .flickr_badge_image img:hover  { border-color:  #<?php 
    echo $skin;
    ?>
;}
<?php 
    for ($i = 1; $i <= 6; $i++) {
        $h = st_get_setting("heading_" . $i, array());
        if (intval($h['font-size']) > 0) {
            echo "h{$i}{ font-size: " . intval($h['font-size']) . "px;} \n";
        }
    }
    ?>
</style>
<?php 
}
Example #8
0
 /**
  * BP WC Products
  */
 function st_wc_products_func($atts, $content = '')
 {
     global $wp_query, $woocommerce;
     global $post, $paged;
     $tmp_post = $post;
     $atts = shortcode_atts(array('cats' => array(), 'number' => 3, 'columns' => 3, 'exclude' => '', 'include' => '', 'offset' => 0, 'pagination' => 'no', 'hide_free' => 'yes', 'order_by' => 'ID', 'order' => 'DESC'), $atts);
     extract($atts);
     if (!st_is_woocommerce()) {
         return '';
     }
     $html = $cat_link = $cat_title = '';
     // just only for one cate
     if (is_string($cats)) {
         $cats = explode(',', $cats);
     }
     $cats = $cats[0];
     if (intval($number) <= 0) {
         $number = (int) get_option('posts_per_page', 10);
     } else {
         $number = intval($number);
     }
     $args = array('posts_per_page' => (int) $number, 'offset' => (int) $offset);
     if ($cats > 0) {
         $args['tax_query'] = array('relation' => 'AND', array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => array($cats), 'operator' => 'IN'));
     }
     $exclude = $exclude != '' ? explode(',', $exclude) : $exclude;
     $include = $include != '' ? explode(',', $include) : $include;
     $args['post__not_in'] = $exclude;
     $args['post__in'] = $include;
     // custom order by meta key
     if (isset($order_by[0]) && $order_by[0] == '_') {
         $order_by = substr($order_by, 1);
         $args['meta_key'] = $order_by;
         $args['orderby'] = 'meta_value_num';
         $args['meta_query'] = array();
         if ($hide_free == 'yes') {
             $args['meta_query'][] = array('key' => '_price', 'value' => 0, 'compare' => '>', 'type' => 'DECIMAL');
         }
         $args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
         $args['meta_query'][] = $woocommerce->query->visibility_meta_query();
     } else {
         $args['orderby'] = $order_by;
     }
     $args['order'] = $order;
     if ($paged > 0) {
         $args['paged'] = $paged;
     } else {
         $paged = isset($_REQUEST['paged']) ? intval($_REQUEST['paged']) : 1;
         $args['paged'] = $paged;
     }
     $args['post_type'] = 'product';
     $args['post_status'] = 'publish';
     if (st_is_wpml()) {
         $args['sippress_filters'] = true;
         $args['language'] = get_bloginfo('language');
     }
     $new_query = new WP_Query($args);
     $myposts = $new_query->posts;
     $i = 0;
     $e = '';
     ob_start();
     $old_content = ob_get_clean();
     if ($type == 3 && count($myposts) % 2 != 0) {
         $myposts[] = false;
     }
     // $image_size = 'large'; // ***
     // show columns
     $columns = intval($columns);
     $columns = $columns > 0 && $columns <= 6 ? $columns : 6;
     // echo $num_col; die();
     global $woocommerce_loop;
     $woocommerce_loop['columns'] = $columns;
     //apply_filters( 'loop_shop_columns', $columns );
     foreach ($myposts as $post) {
         setup_postdata($post);
         global $product;
         $tpl = '';
         ob_start();
         woocommerce_get_template_part('content', 'product');
         $tpl = ob_get_clean();
         $e .= $tpl;
         $i++;
     }
     $html .= $e;
     $html = '<div class="products row">' . $html . '</div>';
     $p = '';
     // if(!is_home() && !is_front_page()) { // only true if not is home page or front page
     if ($pagination == 'yes') {
         $p = st_post_pagination($new_query->max_num_pages, 2, false);
         if ($p != '') {
             $p = '<div class="st-pagination-wrap ">' . $p . '</div>';
         }
     }
     // }
     wp_reset_query();
     echo $old_content;
     $post = $tmp_post;
     setup_postdata($post);
     $html = '<div class="woocommerce-wrap woocommerce  builder-item-wrapper">' . do_shortcode($html) . $p . '</div>';
     $html = apply_filters('st_wc_products_func', $html, $atts);
     return $html;
 }