$product_categories = wp_list_filter($product_categories, array('parent' => $atts['parent'])); } if ($hide_empty) { foreach ($product_categories as $key => $category) { if ($category->count == 0) { unset($product_categories[$key]); } } } if ($atts['number']) { $product_categories = array_slice($product_categories, 0, $atts['number']); } ob_start(); if ($product_categories) { global $woocommerce_carousel; $woocommerce_carousel = $categories_style; foreach ($product_categories as $category) { wc_get_template('content-product_cat_carousel.php', array('category' => $category)); } } wp_reset_postdata(); $carousel_html .= ob_get_clean(); if ($carousel_html) { $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = '<div class="' . esc_attr($elementClass) . '">' . str_replace('%carousel_html%', $carousel_html, $carousel_ouput) . '</div>'; } return $output; } } vc_map(array("name" => esc_html__("KT: Product Categories Carousel", 'cruxstore'), "base" => "categories_carousel", "category" => esc_html__('by Kite-Themes', 'cruxstore'), "params" => array_merge(array(array("type" => "cruxstore_taxonomy", 'taxonomy' => 'product_cat', 'heading' => esc_html__('Categories', 'js_composer'), 'param_name' => 'ids', 'multiple' => true, 'admin_label' => true, 'select' => 'id', 'description' => esc_html__('List of product categories', 'cruxstore')), array('type' => 'dropdown', 'heading' => esc_html__('Categories style', 'js_composer'), 'param_name' => 'categories_style', 'value' => array(esc_html__('Normal', 'cruxstore') => 'normal', esc_html__('Portrait', 'cruxstore') => 'portrait', esc_html__('Modern', 'cruxstore') => 'modern'), 'std' => 'normal', 'admin_label' => true, "description" => esc_html__("Select your categories style.", 'cruxstore')), array('type' => 'textfield', 'heading' => esc_html__('Per Page', 'js_composer'), 'value' => '', 'param_name' => 'per_page', 'description' => esc_html__('The "per_page" shortcode determines how many categories to show on the page', 'js_composer')), "admin_label" => true, array('type' => 'dropdown', 'heading' => esc_html__('Order by', 'js_composer'), 'param_name' => 'orderby', 'value' => array(esc_html__('Name', 'js_composer') => 'name', esc_html__('ID', 'js_composer') => 'id', esc_html__('Count', 'js_composer') => 'count', esc_html__('Slug', 'js_composer') => 'slug', esc_html__('None', 'js_composer') => 'none'), 'std' => 'name', 'param_holder_class' => 'vc_grid-data-type-not-ids', "admin_label" => true), array('type' => 'dropdown', 'heading' => esc_html__('Sorting', 'js_composer'), 'param_name' => 'order', 'value' => array(esc_html__('Ascending', 'js_composer') => 'ASC', esc_html__('Descending', 'js_composer') => 'DESC'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'description' => esc_html__('Select sorting order.', 'js_composer'), "admin_label" => true), array('type' => 'cruxstore_switch', 'heading' => esc_html__('Hide empty', 'cruxstore'), 'param_name' => 'hide_empty', 'value' => 'true', "description" => esc_html__("Hide category if empty.", 'cruxstore')), vc_map_add_css_animation(), array("type" => "textfield", "heading" => esc_html__("Extra class name", "js_composer"), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer"))), cruxstore_map_add_carousel_parrams(), array(array('type' => 'css_editor', 'heading' => esc_html__('Css', 'js_composer'), 'param_name' => 'css', 'group' => esc_html__('Design options', 'js_composer'))))));
$output = $carousel_html = ''; ob_start(); $products = new WP_Query(apply_filters('woocommerce_shortcode_products_query', $args, $atts)); if ($products->have_posts()) { global $woocommerce_loop; $woocommerce_loop['columns'] = $desktop; $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts), '', 'wc-carousel-wrapper'); if ($layout == 'transparent') { $woocommerce_loop['type'] = 'transparent'; } else { $woocommerce_loop['type'] = 'normal'; } woocommerce_product_loop_start(); while ($products->have_posts()) { $products->the_post(); wc_get_template_part('content', 'product'); } // end of the loop. woocommerce_product_loop_end(); } $carousel_html .= ob_get_clean(); wp_reset_postdata(); if ($carousel_html) { $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = '<div class="' . esc_attr($elementClass) . '">' . str_replace('%carousel_html%', $carousel_html, $carousel_ouput) . '</div>'; } return $output; } } vc_map(array("name" => esc_html__("KT: Products Carousel", 'cruxstore'), "base" => "products_carousel", "category" => esc_html__('by Kite-Themes', 'cruxstore'), "params" => array_merge(array(array('type' => 'dropdown', "heading" => esc_html__("Product layout", 'cruxstore'), 'param_name' => 'layout', 'value' => array(esc_html__('Normal', 'woocommerce') => 'normal', esc_html__('Transparent', 'js_composer') => 'transparent'), 'std' => 'normal', 'description' => esc_html__('Select your product layout.', 'cruxstore')), array("type" => "cruxstore_heading", "heading" => esc_html__("Data settings", 'cruxstore'), "param_name" => "data_settings"), array('type' => 'dropdown', "heading" => esc_html__("Data source", 'cruxstore'), 'param_name' => 'source', 'value' => array(esc_html__('All Product', 'woocommerce') => 'all', esc_html__('Featured Products', 'js_composer') => 'featured', esc_html__('On-sale Products', 'js_composer') => 'onsale', esc_html__('Best Sellers', 'js_composer') => 'best-sellers', esc_html__('Specific Categories', 'js_composer') => 'categories', esc_html__('Specific Products', 'js_composer') => 'products'), 'std' => 'all', 'description' => esc_html__('Select your source', 'cruxstore')), array("type" => "cruxstore_taxonomy", 'taxonomy' => 'product_cat', 'heading' => esc_html__('Categories', 'cruxstore'), 'param_name' => 'categories', 'placeholder' => esc_html__('Select your categories', 'cruxstore'), "dependency" => array("element" => "source", "value" => array('categories')), 'multiple' => true), array("type" => "cruxstore_posts", 'args' => array('post_type' => 'product', 'posts_per_page' => -1), 'heading' => esc_html__('Specific Products', 'js_composer'), 'param_name' => 'products', 'size' => '5', 'placeholder' => esc_html__('Select your posts', 'js_composer'), "dependency" => array("element" => "source", "value" => array('products')), 'multiple' => true), array('type' => 'textfield', 'heading' => esc_html__('Per page', 'js_composer'), 'value' => 10, 'param_name' => 'per_page', 'description' => esc_html__('The "per_page" shortcode determines how many products to show on the page', 'js_composer'), "admin_label" => true), array('type' => 'dropdown', 'heading' => esc_html__('Order by', 'js_composer'), 'param_name' => 'orderby', 'value' => array(esc_html__('Date', 'js_composer') => 'date', esc_html__('Order by post ID', 'js_composer') => 'ID', esc_html__('Author', 'js_composer') => 'author', esc_html__('Title', 'js_composer') => 'title', esc_html__('Last modified date', 'js_composer') => 'modified', esc_html__('Post/page parent ID', 'js_composer') => 'parent', esc_html__('Number of comments', 'js_composer') => 'comment_count', esc_html__('Menu order/Page Order', 'js_composer') => 'menu_order', esc_html__('Meta value', 'js_composer') => 'meta_value', esc_html__('Meta value number', 'js_composer') => 'meta_value_num', esc_html__('Random order', 'js_composer') => 'rand'), "dependency" => array("element" => "source", "value" => 'all'), 'description' => esc_html__('Select order type. If "Meta value" or "Meta value Number" is chosen then meta key is required.', 'js_composer'), 'param_holder_class' => 'vc_grid-data-type-not-ids', "admin_label" => true), array('type' => 'textfield', 'heading' => esc_html__('Meta key', 'js_composer'), 'param_name' => 'meta_key', 'param_holder_class' => 'vc_grid-data-type-not-ids', 'dependency' => array('element' => 'orderby', 'value' => array('meta_value', 'meta_value_num')), "admin_label" => true), array('type' => 'dropdown', 'heading' => esc_html__('Sorting', 'js_composer'), 'param_name' => 'order', 'value' => array(esc_html__('Descending', 'js_composer') => 'DESC', esc_html__('Ascending', 'js_composer') => 'ASC'), "dependency" => array("element" => "source", "value" => 'all'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'description' => esc_html__('Select sorting order.', 'js_composer'), "admin_label" => true), array("type" => "cruxstore_heading", "heading" => esc_html__("Others settings", 'cruxstore'), "param_name" => "others_settings"), vc_map_add_css_animation(), array("type" => "textfield", "heading" => esc_html__("Extra class name", "js_composer"), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer"))), cruxstore_map_add_carousel_parrams(), array(array('type' => 'css_editor', 'heading' => esc_html__('Css', 'js_composer'), 'param_name' => 'css', 'group' => esc_html__('Design options', 'js_composer'))))));
} elseif ($source == 'authors') { if ($authors) { $authors_arr = array_filter(explode(',', $authors)); if (count($authors_arr)) { $args['author__in'] = $authors_arr; } } } ob_start(); query_posts($args); if (have_posts()) { while (have_posts()) { the_post(); get_template_part('templates/blog/carousel/content', $loop_stype); } echo "</div><!-- .blog-posts -->"; } wp_reset_query(); remove_filter('excerpt_length', $exl_function, 999); $post_carousel_html = ob_get_clean(); $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'blog-posts-carousel-wrapper ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = ''; $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts)); $output .= str_replace('%carousel_html%', $post_carousel_html, $carousel_ouput); return '<div class="' . esc_attr($elementClass) . '"><div class="blog-posts blog-posts-carousel">' . $output . '</div></div>'; } } // Add your Visual Composer logic here vc_map(array("name" => esc_html__("KT: Blog Posts Carousel", 'cruxstore'), "base" => "blog_posts_carousel", "category" => esc_html__('by Kite-Themes', 'cruxstore'), "params" => array_merge(array(array('type' => 'dropdown', 'heading' => esc_html__('Loop Style', 'cruxstore'), 'param_name' => 'loop_stype', 'value' => array(esc_html__('Style 1', 'js_composer') => 'grid', esc_html__('Style 2', 'js_composer') => 'carousel'), 'std' => 'grid', 'description' => '', 'admin_label' => true), array("type" => "cruxstore_heading", "heading" => esc_html__("Layout setting", 'cruxstore'), "param_name" => "layout_settings"), array('type' => 'textfield', 'heading' => esc_html__('Excerpt length', 'js_composer'), 'value' => 15, 'param_name' => 'excerpt_length'), array("type" => "cruxstore_heading", "heading" => esc_html__("Extra setting", 'cruxstore'), "param_name" => "extra_settings"), vc_map_add_css_animation(), array("type" => "textfield", "heading" => esc_html__("Extra class name", "js_composer"), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer")), array("type" => "dropdown", "heading" => esc_html__("Data source", 'cruxstore'), "param_name" => "source", "value" => array(esc_html__('All', 'cruxstore') => '', esc_html__('Specific Categories', 'cruxstore') => 'categories', esc_html__('Specific Posts', 'cruxstore') => 'posts', esc_html__('Specific Authors', 'cruxstore') => 'authors'), "admin_label" => true, 'std' => '', "description" => esc_html__("Select content type for your posts.", 'cruxstore'), 'group' => esc_html__('Data settings', 'js_composer')), array("type" => "cruxstore_taxonomy", 'taxonomy' => 'category', 'heading' => esc_html__('Categories', 'cruxstore'), 'param_name' => 'categories', 'placeholder' => esc_html__('Select your categories', 'cruxstore'), "dependency" => array("element" => "source", "value" => array('categories')), 'multiple' => true, 'select' => 'id', 'group' => esc_html__('Data settings', 'js_composer')), array("type" => "cruxstore_posts", 'args' => array('post_type' => 'post', 'posts_per_page' => -1), 'heading' => esc_html__('Specific Posts', 'js_composer'), 'param_name' => 'posts', 'size' => '5', 'placeholder' => esc_html__('Select your posts', 'js_composer'), "dependency" => array("element" => "source", "value" => array('posts')), 'multiple' => true, 'group' => esc_html__('Data settings', 'js_composer')), array("type" => "cruxstore_authors", 'post_type' => 'post', 'heading' => esc_html__('Specific Authors', 'js_composer'), 'param_name' => 'authors', 'size' => '5', 'placeholder' => esc_html__('Select your authors', 'js_composer'), "dependency" => array("element" => "source", "value" => array('authors')), 'multiple' => true, 'group' => esc_html__('Data settings', 'js_composer')), array('type' => 'textfield', 'heading' => esc_html__('Total items', 'js_composer'), 'param_name' => 'max_items', 'value' => 10, 'param_holder_class' => 'vc_not-for-custom', 'description' => esc_html__('Set max limit for items in grid or enter -1 to display all (limited to 1000).', 'js_composer'), 'group' => esc_html__('Data settings', 'js_composer')), array('type' => 'dropdown', 'heading' => esc_html__('Order by', 'js_composer'), 'param_name' => 'orderby', 'value' => array(esc_html__('Date', 'js_composer') => 'date', esc_html__('Order by post ID', 'js_composer') => 'ID', esc_html__('Author', 'js_composer') => 'author', esc_html__('Title', 'js_composer') => 'title', esc_html__('Last modified date', 'js_composer') => 'modified', esc_html__('Post/page parent ID', 'js_composer') => 'parent', esc_html__('Number of comments', 'js_composer') => 'comment_count', esc_html__('Menu order/Page Order', 'js_composer') => 'menu_order', esc_html__('Meta value', 'js_composer') => 'meta_value', esc_html__('Meta value number', 'js_composer') => 'meta_value_num', esc_html__('Random order', 'js_composer') => 'rand'), 'description' => esc_html__('Select order type. If "Meta value" or "Meta value Number" is chosen then meta key is required.', 'js_composer'), 'group' => esc_html__('Data settings', 'js_composer'), 'param_holder_class' => 'vc_grid-data-type-not-ids', "admin_label" => true), array('type' => 'textfield', 'heading' => esc_html__('Meta key', 'js_composer'), 'param_name' => 'meta_key', 'group' => esc_html__('Data settings', 'js_composer'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'dependency' => array('element' => 'orderby', 'value' => array('meta_value', 'meta_value_num')), "admin_label" => true), array('type' => 'dropdown', 'heading' => esc_html__('Sorting', 'js_composer'), 'param_name' => 'order', 'group' => esc_html__('Data settings', 'js_composer'), 'value' => array(esc_html__('Descending', 'js_composer') => 'DESC', esc_html__('Ascending', 'js_composer') => 'ASC'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'description' => esc_html__('Select sorting order.', 'js_composer'), "admin_label" => true)), cruxstore_map_add_carousel_parrams(), array(array('type' => 'css_editor', 'heading' => esc_html__('Css', 'js_composer'), 'param_name' => 'css', 'group' => esc_html__('Design options', 'js_composer'))))));
$link = cruxstore_meta('_cruxstore_link_client'); if ($animation_delay) { $animation_delay_item = sprintf(' data-wow-delay="%sms"', $i * $animation_delay); } else { $animation_delay_item = ''; } if ($link) { $post_thumbnail = '<a target="' . $target_link . '" href="' . $link . '">' . get_the_post_thumbnail(get_the_ID(), $img_size) . '</a>'; } else { $post_thumbnail = get_the_post_thumbnail(get_the_ID(), $img_size, ''); } $client_carousel_html .= sprintf('<div class="%s" %s>%s</div>', 'clients-carousel-item' . $css_animation, $animation_delay_item, $post_thumbnail); $i++; } wp_reset_postdata(); } $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'clients-carousel ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' ')); if ($image_overlay) { $elementClass['overlay'] = 'overlay-' . $image_overlay; } $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass)); $output = ''; $output .= '<div class="' . esc_attr($elementClass) . '">'; $carousel_ouput = cruxstore_render_carousel(apply_filters('cruxstore_render_args', $atts)); $output .= str_replace('%carousel_html%', $client_carousel_html, $carousel_ouput); $output .= '</div>'; return $output; } } vc_map(array("name" => esc_html__("KT: Clients Carousel", 'cruxstore'), "base" => "clients_carousel", "category" => esc_html__('by Kite-Themes', 'cruxstore'), "wrapper_class" => "clearfix", "params" => array_merge(array(array("type" => "cruxstore_image_sizes", "heading" => esc_html__("Select image sizes", 'cruxstore'), "param_name" => "img_size", 'description' => esc_html__('Select size of image', 'cruxstore')), array('type' => 'dropdown', 'heading' => esc_html__('Target Link', 'cruxstore'), 'param_name' => 'target_link', 'value' => array(esc_html__('Self', 'cruxstore') => '_self', esc_html__('Blank', 'cruxstore') => '_blank', esc_html__('Parent', 'cruxstore') => '_parent', esc_html__('Top', 'cruxstore') => '_top'), 'description' => esc_html__('Select target link.', 'cruxstore')), array('type' => 'dropdown', 'heading' => esc_html__('Image Overlay', 'cruxstore'), 'param_name' => 'image_overlay', 'value' => array(esc_html__('Default', 'cruxstore') => '', esc_html__('Grayscale', 'cruxstore') => 'grayscale', esc_html__('White', 'cruxstore') => 'white', esc_html__('White Boxed', 'cruxstore') => 'white-boxed'), 'description' => esc_html__('Select image overlay for image.', 'cruxstore')), array("type" => "dropdown", "heading" => esc_html__("Data source", 'cruxstore'), "param_name" => "source", "value" => array(esc_html__('All', 'cruxstore') => '', esc_html__('Specific Categories', 'cruxstore') => 'categories', esc_html__('Specific Client', 'cruxstore') => 'posts'), "admin_label" => true, 'std' => 'all', "description" => esc_html__("Select content type for your posts.", 'cruxstore'), 'group' => esc_html__('Data settings', 'js_composer')), array("type" => "cruxstore_taxonomy", 'taxonomy' => 'client-category', 'heading' => esc_html__('Categories', 'cruxstore'), 'param_name' => 'categories', 'placeholder' => esc_html__('Select your categories', 'cruxstore'), "dependency" => array("element" => "source", "value" => array('categories')), 'multiple' => true, 'group' => esc_html__('Data settings', 'js_composer')), array("type" => "cruxstore_posts", 'args' => array('post_type' => 'crux_client', 'posts_per_page' => -1), 'heading' => esc_html__('Specific Client', 'js_composer'), 'param_name' => 'posts', 'placeholder' => esc_html__('Select your posts', 'js_composer'), "dependency" => array("element" => "source", "value" => array('posts')), 'multiple' => true, 'group' => esc_html__('Data settings', 'js_composer')), array('type' => 'dropdown', 'heading' => esc_html__('Order by', 'js_composer'), 'param_name' => 'orderby', 'value' => array(esc_html__('Date', 'js_composer') => 'date', esc_html__('Order by post ID', 'js_composer') => 'ID', esc_html__('Author', 'js_composer') => 'author', esc_html__('Title', 'js_composer') => 'title', esc_html__('Last modified date', 'js_composer') => 'modified', esc_html__('Post/page parent ID', 'js_composer') => 'parent', esc_html__('Number of comments', 'js_composer') => 'comment_count', esc_html__('Menu order/Page Order', 'js_composer') => 'menu_order', esc_html__('Meta value', 'js_composer') => 'meta_value', esc_html__('Meta value number', 'js_composer') => 'meta_value_num', esc_html__('Random order', 'js_composer') => 'rand'), 'description' => esc_html__('Select order type. If "Meta value" or "Meta value Number" is chosen then meta key is required.', 'js_composer'), 'group' => esc_html__('Data settings', 'js_composer'), 'param_holder_class' => 'vc_grid-data-type-not-ids', "admin_label" => true), array('type' => 'textfield', 'heading' => esc_html__('Meta key', 'js_composer'), 'param_name' => 'meta_key', 'description' => esc_html__('Input meta key for grid ordering.', 'js_composer'), 'group' => esc_html__('Data settings', 'js_composer'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'dependency' => array('element' => 'orderby', 'value' => array('meta_value', 'meta_value_num')), "admin_label" => true), array('type' => 'dropdown', 'heading' => esc_html__('Sorting', 'js_composer'), 'param_name' => 'order', 'group' => esc_html__('Data settings', 'js_composer'), 'value' => array(esc_html__('Descending', 'js_composer') => 'DESC', esc_html__('Ascending', 'js_composer') => 'ASC'), 'param_holder_class' => 'vc_grid-data-type-not-ids', 'description' => esc_html__('Select sorting order.', 'js_composer'), "admin_label" => true), cruxstore_map_add_css_animation(), cruxstore_map_add_css_animation_delay(), array("type" => "textfield", "heading" => esc_html__("Extra class name", "js_composer"), "param_name" => "el_class", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "js_composer"))), cruxstore_map_add_carousel_parrams(), array(array('type' => 'css_editor', 'heading' => esc_html__('Css', 'js_composer'), 'param_name' => 'css', 'group' => esc_html__('Design options', 'js_composer'))))));