コード例 #1
0
 function TS_VCSC_WooCommerce_Grid_Basic_Function($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     global $product;
     global $woocommerce;
     ob_start();
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
             wp_enqueue_style('ts-visual-composer-extend-front');
         }
     } else {
         wp_enqueue_script('ts-extend-hammer');
         wp_enqueue_script('ts-extend-nacho');
         wp_enqueue_style('ts-extend-nacho');
         wp_enqueue_style('ts-extend-dropdown');
         wp_enqueue_script('ts-extend-dropdown');
         wp_enqueue_style('ts-font-ecommerce');
         wp_enqueue_style('ts-extend-animations');
         wp_enqueue_style('dashicons');
         if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
             wp_enqueue_style('ts-extend-buttons');
             wp_enqueue_style('ts-visual-composer-extend-front');
             wp_enqueue_script('ts-extend-isotope');
             wp_enqueue_script('ts-visual-composer-extend-front');
         }
         add_action('wp_footer', array($this, 'TS_VCSC_WooCommerce_Grid_Function_Isotope'), 9999);
     }
     extract(shortcode_atts(array('selection' => 'recent_products', 'category' => '', 'ids' => '', 'orderby' => 'date', 'order' => 'desc', 'products_total' => 12, 'exclude_outofstock' => 'false', 'show_image' => 'true', 'show_link' => 'true', 'link_page' => 'false', 'link_target' => '_parent', 'show_rating' => 'true', 'show_stock' => 'true', 'show_price' => 'true', 'show_cart' => 'true', 'show_info' => 'true', 'show_content' => 'excerpt', 'cutoff_characters' => 400, 'lightbox_group_name' => 'nachogroup', 'lightbox_size' => 'full', 'lightbox_effect' => 'random', 'lightbox_speed' => 5000, 'lightbox_social' => 'true', 'lightbox_backlight_choice' => 'predefined', 'lightbox_backlight_color' => '#0084E2', 'lightbox_backlight_custom' => '#000000', 'image_position' => 'ts-imagefloat-center', 'hover_type' => 'ts-imagehover-style1', 'hover_active' => 'false', 'overlay_trigger' => 'ts-trigger-hover', 'rating_maximum' => 5, 'rating_value' => 0, 'rating_dynamic' => '', 'rating_quarter' => 'true', 'rating_size' => 16, 'rating_auto' => 'false', 'rating_rtl' => 'false', 'rating_symbol' => 'other', 'rating_icon' => 'ts-ecommerce-starfull1', 'color_rated' => '#FFD800', 'color_empty' => '#e3e3e3', 'caption_show' => 'false', 'caption_position' => 'left', 'caption_digits' => '.', 'caption_danger' => '#d9534f', 'caption_warning' => '#f0ad4e', 'caption_info' => '#5bc0de', 'caption_primary' => '#428bca', 'caption_success' => '#5cb85c', 'post_type' => 'product', 'date_format' => 'F j, Y', 'time_format' => 'l, g:i A', 'filter_menu' => 'true', 'layout_menu' => 'true', 'sort_menu' => 'false', 'directions_menu' => 'false', 'filter_by' => 'product_cat', 'layout' => 'masonry', 'column_width' => 285, 'layout_break' => 600, 'show_periods' => 'false', 'sort_by' => 'postName', 'sort_order' => 'asc', 'posts_limit' => 25, 'posts_lazy' => 'false', 'posts_ajax' => 10, 'posts_load' => 'Show More', 'posts_trigger' => 'click', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $postsgrid_random = mt_rand(999999, 9999999);
     $opening = $closing = $controls = $products = '';
     $posts_limit = $products_total;
     if (!empty($el_id)) {
         $posts_container_id = $el_id;
     } else {
         $posts_container_id = 'ts-vcsc-woocommerce-grid-' . $postsgrid_random;
     }
     // Backlight Color
     if ($lightbox_backlight_choice == "predefined") {
         $lightbox_backlight_selection = $lightbox_backlight_color;
     } else {
         $lightbox_backlight_selection = $lightbox_backlight_custom;
     }
     // Check for Front End Editor
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $product_style = '';
         $frontend_edit = 'true';
         $description_style = 'display: none; padding: 15px;';
     } else {
         $product_style = '';
         $frontend_edit = 'false';
         $description_style = 'display: none; padding: 15px;';
     }
     $meta_query = '';
     // Recent Products
     if ($selection == "recent_products") {
         $meta_query = WC()->query->get_meta_query();
     }
     // Featured Products
     if ($selection == "featured_products") {
         $meta_query = array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'), array('key' => '_featured', 'value' => 'yes'));
     }
     // Top Rated Products
     if ($selection == "top_rated_products") {
         add_filter('posts_clauses', array(WC()->query, 'order_by_rating_post_clauses'));
         $meta_query = WC()->query->get_meta_query();
     }
     // Final Query Arguments
     $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $products_total, 'orderby' => $orderby, 'order' => $order, 'paged' => 1, 'meta_query' => $meta_query);
     // Products on Sale
     if ($selection == "sale_products") {
         $product_ids_on_sale = woocommerce_get_product_ids_on_sale();
         $meta_query = array();
         $meta_query[] = $woocommerce->query->visibility_meta_query();
         $meta_query[] = $woocommerce->query->stock_status_meta_query();
         $args['meta_query'] = $meta_query;
         $args['post__in'] = $product_ids_on_sale;
     }
     // Best Selling Products
     if ($selection == "best_selling_products") {
         $args['meta_key'] = 'total_sales';
         $args['orderby'] = 'meta_value_num';
         $args['meta_query'] = array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'));
     }
     // Products in Single Category
     if ($selection == "product_category") {
         $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => array(esc_attr($category)), 'field' => 'slug', 'operator' => 'IN'));
     }
     // Products in Multiple Categories
     if ($selection == "product_categories") {
         $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => explode(",", $ids), 'field' => 'term_id', 'operator' => 'IN'));
     }
     $menu_tax = 'product_cat';
     $limit_tax = 'product_cat';
     // Start WordPress Query
     $loop = new WP_Query($args);
     // Language Settings: Isotope Posts
     $TS_VCSC_Isotope_Posts_Language = get_option('ts_vcsc_extend_settings_translationsIsotopePosts', '');
     if ($TS_VCSC_Isotope_Posts_Language == false || empty($TS_VCSC_Isotope_Posts_Language)) {
         $TS_VCSC_Isotope_Posts_Language = $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_Isotope_Posts_Language_Defaults;
     }
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_WooCommerce_Grid_Basic', $atts);
     } else {
         $css_class = '';
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == 'false') {
         $isotope_posts_list_class = 'ts-posts-timeline-view';
     } else {
         $isotope_posts_list_class = 'ts-posts-timeline-edit';
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == 'true') {
         echo '<div id="ts-isotope-posts-grid-frontend-' . $postsgrid_random . '" class="ts-isotope-posts-grid-frontend" style="border: 1px solid #ededed; padding: 10px;">';
         echo '<div style="font-weight: bold;">"Basic Products Isotope Grid"</div>';
         echo '<div style="margin-bottom: 20px;">The element has been disabled in order to ensure compatiblity with the Visual Composer Front-End Editor.</div>';
         echo '<div>' . __("Number of Products", "ts_visual_composer_extend") . ': ' . $posts_limit . '</div>';
         $front_edit_reverse = array("excerpt" => __('Excerpt', "ts_visual_composer_extend"), "cutcharacters" => __('Character Limited Content', "ts_visual_composer_extend"), "complete" => __('Full Content', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $show_content) {
                 echo '<div>' . __("Content Length", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         $front_edit_reverse = array("masonry" => __('Centered Masonry', "ts_visual_composer_extend"), "fitRows" => __('Fit Rows', "ts_visual_composer_extend"), "straightDown" => __('Straight Down', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $layout) {
                 echo '<div>' . __("Content", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         $front_edit_reverse = array("postName" => __('Product Name', "ts_visual_composer_extend"), "postPrice" => __('Product Price', "ts_visual_composer_extend"), "postRating" => __('Product Rating', "ts_visual_composer_extend"), "postDate" => __('Product Date', "ts_visual_composer_extend"), "postModified" => __('Product Modified', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $sort_by) {
                 echo '<div>' . __("Sort Criterion", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         $front_edit_reverse = array("asc" => __('Bottom to Top', "ts_visual_composer_extend"), "desc" => __('Top to Bottom', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $sort_order) {
                 echo '<div>' . __("Initial Order", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         echo '<div>' . __("Show Filter Button", "ts_visual_composer_extend") . ': ' . $filter_menu . '</div>';
         echo '<div>' . __("Show Layout Button", "ts_visual_composer_extend") . ': ' . $layout_menu . '</div>';
         echo '<div>' . __("Show Sort Criterion Button", "ts_visual_composer_extend") . ': ' . $sort_menu . '</div>';
         echo '<div>' . __("Show Directions Buttons", "ts_visual_composer_extend") . ': ' . $directions_menu . '</div>';
         echo '</div>';
     } else {
         $opening .= '<div id="' . $posts_container_id . '" class="ts-isotope-posts-grid-parent ' . ($layout == 'spineTimeline' ? 'ts-timeline ' : 'ts-postsgrid ') . 'ts-timeline-' . $sort_order . ' ts-posts-timeline ' . $isotope_posts_list_class . ' ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . ';" data-lazy="' . $posts_lazy . '" data-count="' . $posts_limit . '" data-ajax="' . $posts_ajax . '" data-trigger="' . $posts_trigger . '" data-column="' . $column_width . '" data-layout="' . $layout . '" data-sort="' . $sort_by . '" data-order="' . $sort_order . '" data-break="' . $layout_break . '" data-type="' . $post_type . '">';
         // Create Individual Post Output
         $postCounter = 0;
         $postCategories = array();
         $categoriesCount = 0;
         if (post_type_exists($post_type) && $loop->have_posts()) {
             $products .= '<div class="ts-timeline-content">';
             $products .= '<ul id="ts-isotope-posts-grid-' . $postsgrid_random . '" class="ts-isotope-posts-grid ts-timeline-list" data-layout="' . $layout . '" data-key="' . $postsgrid_random . '">';
             while ($loop->have_posts()) {
                 $loop->the_post();
                 $postCounter++;
                 $product_id = get_the_ID();
                 $product_title = get_the_title($product_id);
                 $post = get_post($product_id);
                 $product = new WC_Product($product_id);
                 $attachment_ids = $product->get_gallery_attachment_ids();
                 $price = $product->get_price_html();
                 $product_sku = $product->get_sku();
                 $attributes = $product->get_attributes();
                 $stock = $product->is_in_stock() ? 'true' : 'false';
                 $onsale = $product->is_on_sale() ? 'true' : 'false';
                 // Rating Settings
                 $rating_html = $product->get_rating_html();
                 $rating = $product->get_average_rating();
                 if ($rating == '') {
                     $rating = 0;
                 }
                 if ($rating_quarter == "true") {
                     $rating_value = floor($rating * 4) / 4;
                 } else {
                     $rating_value = $rating;
                 }
                 $rating_value = number_format($rating_value, 2, $caption_digits, '');
                 if ($rating_rtl == "false") {
                     $rating_width = $rating_value / $rating_maximum * 100;
                 } else {
                     $rating_width = 100 - $rating_value / $rating_maximum * 100;
                 }
                 if ($rating_symbol == "other") {
                     if ($rating_icon == "ts-ecommerce-starfull1") {
                         $rating_class = 'ts-rating-stars-star1';
                     } else {
                         if ($rating_icon == "ts-ecommerce-starfull2") {
                             $rating_class = 'ts-rating-stars-star2';
                         } else {
                             if ($rating_icon == "ts-ecommerce-starfull3") {
                                 $rating_class = 'ts-rating-stars-star3';
                             } else {
                                 if ($rating_icon == "ts-ecommerce-starfull4") {
                                     $rating_class = 'ts-rating-stars-star4';
                                 } else {
                                     if ($rating_icon == "ts-ecommerce-heartfull") {
                                         $rating_class = 'ts-rating-stars-heart1';
                                     } else {
                                         if ($rating_icon == "ts-ecommerce-heart") {
                                             $rating_class = 'ts-rating-stars-heart2';
                                         } else {
                                             if ($rating_icon == "ts-ecommerce-thumbsup") {
                                                 $rating_class = 'ts-rating-stars-thumb';
                                             } else {
                                                 if ($rating_icon == "ts-ecommerce-ribbon4") {
                                                     $rating_class = 'ts-rating-stars-ribbon';
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     $rating_class = 'ts-rating-stars-smile';
                 }
                 if ($rating_value >= 0 && $rating_value <= 1) {
                     $caption_class = 'ts-label-danger';
                     $caption_background = 'background-color: ' . $caption_danger . ';';
                 } else {
                     if ($rating_value > 1 && $rating_value <= 2) {
                         $caption_class = 'ts-label-warning';
                         $caption_background = 'background-color: ' . $caption_warning . ';';
                     } else {
                         if ($rating_value > 2 && $rating_value <= 3) {
                             $caption_class = 'ts-label-info';
                             $caption_background = 'background-color: ' . $caption_info . ';';
                         } else {
                             if ($rating_value > 3 && $rating_value <= 4) {
                                 $caption_class = 'ts-label-primary';
                                 $caption_background = 'background-color: ' . $caption_primary . ';';
                             } else {
                                 if ($rating_value > 4 && $rating_value <= 5) {
                                     $caption_class = 'ts-label-success';
                                     $caption_background = 'background-color: ' . $caption_success . ';';
                                 }
                             }
                         }
                     }
                 }
                 if (has_post_thumbnail($loop->post->ID)) {
                     $featured = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                     $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');
                     $featured = $featured[0];
                     $thumbnail = $thumbnail[0];
                 } else {
                     $featured = woocommerce_placeholder_img_src();
                     $thumbnail = $featured;
                 }
                 $title = get_the_title();
                 // Create Output
                 if ($postCounter < $posts_limit + 1) {
                     $postAttributes = 'data-visible="false" data-price="' . TS_VCSC_CleanNumberData($product->price) . '" data-rating="' . TS_VCSC_CleanNumberData($rating) . '" data-full="' . get_post_time($date_format) . '" data-author="' . get_the_author() . '" data-date="' . get_post_time('U') . '" data-modified="' . get_the_modified_time('U') . '" data-title="' . get_the_title() . '" data-comments="' . get_comments_number() . '" data-id="' . get_the_ID() . '"';
                     if ($exclude_outofstock == "true" && $stock == "true" || $exclude_outofstock == "false") {
                         $product_categories = '';
                         if ($filter_menu == 'true' && taxonomy_exists($menu_tax)) {
                             foreach (get_the_terms($loop->post->ID, $menu_tax) as $term) {
                                 $product_categories .= $term->slug . ' ';
                                 $category_check = 0;
                                 foreach ($postCategories as $index => $array) {
                                     if ($postCategories[$index]['slug'] == $term->slug) {
                                         $category_check++;
                                     }
                                 }
                                 if ($category_check == 0) {
                                     $categoriesCount++;
                                     $categories_array = array('slug' => $term->slug, 'name' => $term->name);
                                     $postCategories[] = $categories_array;
                                 }
                             }
                         }
                         $product_categories .= 'rating-' . TS_VCSC_CleanNumberData($rating) . ' ';
                         $products .= '<li class="ts-timeline-list-item ts-timeline-date-true ts-isotope-posts-list-item ' . $product_categories . '" ' . $postAttributes . ' style="margin: 10px;">';
                         $products .= '<div class="ts-woocommerce-product-slide" style="' . $product_style . '" data-hash="' . $product_id . '">';
                         $products .= '<div id="ts-woocommerce-product-' . $product_id . '" class="ts-image-hover-frame ' . $image_position . ' ts-trigger-hover-adjust" style="width: 100%;">';
                         $products .= '<div id="ts-woocommerce-product-' . $product_id . '-counter" class="ts-fluid-wrapper " style="width: 100%; height: auto;">';
                         $products .= '<div id="ts-woocommerce-product-' . $product_id . '-mask" class="ts-imagehover ' . $hover_type . ' ts-trigger-hover" data-trigger="ts-trigger-hover" data-closer="" style="width: 100%; height: auto;">';
                         // Product Thumbnail
                         $products .= '<div class="ts-woocommerce-product-preview">';
                         $products .= '<img class="ts-woocommerce-product-image" src="' . $featured . '" alt="" />';
                         $products .= '</div>';
                         // Sale Ribbon
                         if ($onsale == "true") {
                             $products .= '<div class="ts-woocommerce-product-ribbon"></div>';
                             $products .= '<i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-sale ts-ecommerce-tagsale"></i>';
                         }
                         $products .= '<div class="ts-woocommerce-product-main">';
                         $products .= '<div class="mask" style="width: 100%; display: block;">';
                         $products .= '<div id="ts-woocommerce-product-' . $product_id . '-maskcontent" class="maskcontent" style="margin: 0; padding: 0;">';
                         // Product Thubmnail
                         if ($show_image == "true") {
                             if ($link_page == "false") {
                                 $products .= '<div class="ts-woocommerce-link-wrapper"><a id="" class="nch-lightbox-media" data-title="' . $title . '" rel="" href="' . $featured . '" target="' . $link_target . '">';
                                 $products .= '<div class="ts-woocommerce-product-thumbnail" style="background-image: url(' . $thumbnail . ');"></div>';
                                 $products .= '</a></div>';
                             } else {
                                 $products .= '<div class="ts-woocommerce-link-wrapper"><a id="" class="" data-title="' . $title . '" rel="" href="' . get_permalink() . '" target="' . $link_target . '">';
                                 $products .= '<div class="ts-woocommerce-product-thumbnail" style="background-image: url(' . $thumbnail . ');"></div>';
                                 $products .= '</a></div>';
                             }
                         }
                         // Product Page Link
                         if ($show_link == "true") {
                             $products .= '<div class="ts-woocommerce-link-wrapper"><a href="' . get_permalink() . '" class="ts-woocommerce-product-link" target="_blank"><i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-view ts-ecommerce-forward"></i></a></div>';
                         }
                         // Product Rating
                         if ($show_rating == "true") {
                             $products .= '<div class="ts-rating-stars-frame" data-auto="' . $rating_auto . '" data-size="' . $rating_size . '" data-width="' . $rating_size * 5 . '" data-rating="' . $rating_value . '" style="margin: 10px 0 0 10px; float: left;">';
                             $products .= '<div class="ts-star-rating' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-active " style="font-size: ' . $rating_size . 'px; line-height: ' . ($rating_size + 5) . 'px;">';
                             if ($caption_show == "true" && $caption_position == "left") {
                                 $products .= '<div class="ts-rating-caption" style="margin-right: 10px;">';
                                 if ($rating_rtl == "false") {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                                 } else {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                                 }
                                 $products .= '</div>';
                             }
                             $products .= '<div class="ts-rating-container' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-glyph-holder ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_empty : $color_rated) . ';">';
                             $products .= '<div class="ts-rating-stars ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_rated : $color_empty) . '; width: ' . $rating_width . '%;"></div>';
                             $products .= '</div>';
                             if ($caption_show == "true" && $caption_position == "right") {
                                 $products .= '<div class="ts-rating-caption" style="margin-left: 10px;">';
                                 if ($rating_rtl == "false") {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                                 } else {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                                 }
                                 $products .= '</div>';
                             }
                             $products .= '</div>';
                             $products .= '</div>';
                         }
                         // Product Price
                         if ($show_price == "true") {
                             $products .= '<div class="ts-woocommerce-product-price">';
                             $products .= '<i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-cost ts-ecommerce-pricetag3"></i>';
                             if ($product->price > 0) {
                                 if ($product->price && isset($product->regular_price)) {
                                     $from = $product->regular_price;
                                     $to = $product->price;
                                     if ($from != $to) {
                                         $products .= '<div class="ts-woocommerce-product-regular"><del>' . (is_numeric($from) ? woocommerce_price($from) : $from) . '</del> | </div><div class="ts-woocommerce-product-special">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                     } else {
                                         $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                     }
                                 } else {
                                     $to = $product->price;
                                     $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                 }
                             } else {
                                 $to = $product->price;
                                 $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             }
                             $products .= '</div>';
                         }
                         $products .= '<div class="ts-woocommerce-product-line"></div>';
                         // Add to Cart Button (Icon)
                         if ($show_cart == "true") {
                             $products .= '<div class="ts-woocommerce-link-wrapper"><a class="ts-woocommerce-product-purchase" href="?add-to-cart=' . $product_id . '" rel="nofollow" data-id="' . $product_id . '" data-sku="' . $product_sku . '"><i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-cart ts-ecommerce-cart4"></i></a></div>';
                         }
                         // View Description Button
                         if ($show_info == "true") {
                             $products .= '<div id="ts-vcsc-modal-' . $product_id . '-trigger" style="" class="ts-vcsc-modal-' . $product_id . '-parent nch-holder ts-vcsc-font-icon ts-font-icons ts-shortcode ts-icon-align-center" style="">';
                             $products .= '<a href="#ts-vcsc-modal-' . $product_id . '" class="nch-lightbox-modal" data-title="" data-open="false" data-delay="0" data-type="html" rel="" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" data-color="' . $lightbox_backlight_selection . '">';
                             $products .= '<span class="">';
                             $products .= '<i class="ts-font-icon ts-woocommerce-product-icon ts-woocommerce-product-info ts-ecommerce-information1" style=""></i>';
                             $products .= '</span>';
                             $products .= '</a>';
                             $products .= '</div>';
                         }
                         // Product In-Stock or Unavailable
                         if ($show_stock == "true") {
                             $products .= '<div class="ts-woocommerce-product-status">';
                             if ($stock == 'false') {
                                 $products .= '<div class="ts-woocommerce-product-stock"><span class="ts-woocommerce-product-outofstock">' . __('Out of Stock', 'woocommerce') . '</span></div>';
                             } else {
                                 if ($stock == 'true') {
                                     $products .= '<div class="ts-woocommerce-product-stock"><span class="ts-woocommerce-product-instock">' . __('In Stock', 'woocommerce') . '</span></div>';
                                 }
                             }
                             $products .= '</div>';
                         }
                         $products .= '</div>';
                         $products .= '</div>';
                         $products .= '</div>';
                         $products .= '</div>';
                         $products .= '</div>';
                         $products .= '</div>';
                         // Product Title
                         $products .= '<h2 class="ts-woocommerce-product-title">';
                         $products .= $title;
                         $products .= '</h2>';
                         // Product Description
                         if ($show_info == "true") {
                             $products .= '<div id="ts-vcsc-modal-' . $product_id . '" class="ts-modal-content nch-hide-if-javascript" style="' . $description_style . '">';
                             $products .= '<div class="ts-modal-white-header"></div>';
                             $products .= '<div class="ts-modal-white-frame">';
                             $products .= '<div class="ts-modal-white-inner">';
                             $products .= '<h2 style="border-bottom: 1px solid #eeeeee; padding-bottom: 10px; line-height: 32px; font-size: 24px; text-align: left;">' . $title . '</h2>';
                             $products .= '<div class="ts-woocommerce-lightbox-frame" style="width: 100%; height: 32px; margin: 10px auto; padding: 0;">';
                             $products .= '<a style="position: inherit; margin-left: 10px; float: right;" class="ts-woocommerce-product-purchase" href="?add-to-cart=' . $product_id . '" rel="nofollow" data-id="' . $product_id . '" data-sku="' . $product_sku . '"><i style="color: #000000;" class="ts-woocommerce-product-icon ts-woocommerce-product-cart ts-ecommerce-cart4"></i></a>';
                             $products .= '<a href="' . get_permalink() . '" target="_parent" style="position: inherit; margin-left: 10px; float: right;" class="ts-woocommerce-product-link"><i style="color: #000000;" class="ts-woocommerce-product-icon ts-woocommerce-product-view ts-ecommerce-forward"></i></a>';
                             $products .= '<div class="ts-rating-stars-frame" data-auto="' . $rating_auto . '" data-size="' . $rating_size . '" data-width="' . $rating_size * 5 . '" data-rating="' . $rating_value . '" style="margin: 0; float: right;">';
                             $products .= '<div class="ts-star-rating' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-active " style="font-size: ' . $rating_size . 'px; line-height: ' . ($rating_size + 5) . 'px;">';
                             if ($caption_show == "true" && $caption_position == "left") {
                                 $products .= '<div class="ts-rating-caption" style="margin-right: 10px;">';
                                 if ($rating_rtl == "false") {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                                 } else {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                                 }
                                 $products .= '</div>';
                             }
                             $products .= '<div class="ts-rating-container' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-glyph-holder ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_empty : $color_rated) . ';">';
                             $products .= '<div class="ts-rating-stars ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_rated : $color_empty) . '; width: ' . $rating_width . '%;"></div>';
                             $products .= '</div>';
                             if ($caption_show == "true" && $caption_position == "right") {
                                 $products .= '<div class="ts-rating-caption" style="margin-left: 10px;">';
                                 if ($rating_rtl == "false") {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                                 } else {
                                     $products .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                                 }
                                 $products .= '</div>';
                             }
                             $products .= '</div>';
                             $products .= '</div>';
                             $products .= '<div class="ts-woocommerce-product-price" style="position: inherit; margin-right: 10px; float: left; width: auto; margin-top: 0;">';
                             $products .= '<i style="color: #000000; margin: 0 10px 0 0;" class="ts-woocommerce-product-icon ts-woocommerce-product-cost ts-ecommerce-pricetag3"></i>';
                             if ($product->price > 0) {
                                 if ($product->price && isset($product->regular_price)) {
                                     $from = $product->regular_price;
                                     $to = $product->price;
                                     if ($from != $to) {
                                         $products .= '<div class="ts-woocommerce-product-regular"><del style="color: #7F0000;">' . (is_numeric($from) ? woocommerce_price($from) : $from) . '</del> | </div><div class="ts-woocommerce-product-special">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                     } else {
                                         $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                     }
                                 } else {
                                     $to = $product->price;
                                     $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                                 }
                             } else {
                                 $to = $product->price;
                                 $products .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             }
                             $products .= '</div>';
                             $products .= '</div>';
                             $products .= '<div class="ts-woocommerce-product-seperator" style="border-bottom: 1px solid #eeeeee; margin: 10px auto 20px auto; width: 100%;"></div>';
                             $products .= '<img style="width: 100%; max-width: 250px; height: auto; margin: 10px auto;" class="ts-woocommerce-product-image" src="' . $featured . '" alt="" />';
                             $products .= '<div class="ts-woocommerce-product-seperator" style="border-bottom: 1px solid #eeeeee; margin: 20px auto 10px auto; width: 100%;"></div>';
                             $products .= '<div style="margin-top: 20px; text-align: justify;">';
                             if ($show_content == "excerpt") {
                                 $products .= get_the_excerpt();
                             } else {
                                 if ($show_content == "cutcharacters") {
                                     $content = apply_filters('the_content', get_the_content());
                                     $excerpt = TS_VCSC_TruncateHTML($content, $cutoff_characters, '...', false, true);
                                     $products .= $excerpt;
                                 } else {
                                     if ($show_content == "complete") {
                                         $products .= get_the_content();
                                     }
                                 }
                             }
                             $products .= '</div>';
                             $products .= '</div>';
                             $products .= '</div>';
                             $products .= '</div>';
                         }
                         $products .= '</div>';
                         $products .= '</li>';
                     }
                 }
             }
             $products .= '</ul>';
             $products .= '</div>';
             if ($posts_lazy == "true") {
                 $products .= '<div class="ts-load-more-wrap">';
                 $products .= '<span class="ts-timeline-load-more">' . $posts_load . '</span>';
                 $products .= '</div>';
             }
             wp_reset_postdata();
         } else {
             $products .= '<p>Nothing found. Please check back soon!</p>';
         }
         // Create Post Controls (Filter, Sort)
         $controls .= '<div id="ts-isotope-posts-grid-controls-' . $postsgrid_random . '" class="ts-isotope-posts-grid-controls">';
         if ($directions_menu == 'true' && $posts_lazy == 'false') {
             $controls .= '<div class="ts-button ts-button-flat ts-timeline-controls-desc ts-isotope-posts-controls-desc ' . ($sort_order == "desc" ? "active" : "") . '"><span class="ts-isotope-posts-controls-desc-image"></span></div>';
             $controls .= '<div class="ts-button ts-button-flat ts-timeline-controls-asc ts-isotope-posts-controls-asc ' . ($sort_order == "asc" ? "active" : "") . '"><span class="ts-isotope-posts-controls-asc-image"></span></div>';
         }
         $controls .= '<div class="ts-isotope-posts-grid-controls-menus">';
         if ($filter_menu == 'true') {
             if ($categoriesCount > 1) {
                 $controls .= '<div id="ts-isotope-posts-filter-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-filter-trigger" data-dropdown="#ts-isotope-posts-filter-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['WooFilterProducts'] . '</span></div>';
                 $controls .= '<div id="ts-isotope-posts-filter-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
                 $controls .= '<ul id="" class="ts-dropdown-menu">';
                 $controls .= '<li><label style="font-weight: bold;"><input class="ts-isotope-posts-filter ts-isotope-posts-filter-all" type="checkbox" style="margin-right: 10px;" checked="checked" data-type="all" data-key="' . $postsgrid_random . '" data-filter="*">' . $TS_VCSC_Isotope_Posts_Language['SeeAll'] . '</label></li>';
                 $controls .= '<li class="ts-dropdown-divider"></li>';
                 foreach ($postCategories as $index => $array) {
                     $controls .= '<li><label><input class="ts-isotope-posts-filter ts-isotope-posts-filter-single" type="checkbox" style="margin-right: 10px;" data-type="single" data-key="' . $postsgrid_random . '" data-filter=".' . $postCategories[$index]['slug'] . '">' . $postCategories[$index]['name'] . '</label></li>';
                 }
                 $controls .= '</ul>';
                 $controls .= '</div>';
             }
         }
         if ($layout_menu == 'true') {
             $controls .= '<div id="ts-isotope-posts-layout-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-layout-trigger" data-dropdown="#ts-isotope-posts-layout-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['ButtonLayout'] . '</span></div>';
             $controls .= '<div id="ts-isotope-posts-layout-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
             $controls .= '<ul id="" class="ts-dropdown-menu">';
             $controls .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="masonry" style="margin-right: 10px;" ' . ($layout == 'masonry' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Masonry'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="fitRows" style="margin-right: 10px;" ' . ($layout == 'fitRows' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['FitRows'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="straightDown" style="margin-right: 10px;" ' . ($layout == 'straightDown' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['StraightDown'] . '</label></li>';
             $controls .= '</ul>';
             $controls .= '</div>';
         }
         if ($sort_menu == 'true') {
             $controls .= '<div id="ts-isotope-posts-sort-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-sort-trigger" data-dropdown="#ts-isotope-posts-sort-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['ButtonSort'] . '</span></div>';
             $controls .= '<div id="ts-isotope-posts-sort-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
             $controls .= '<ul id="" class="ts-dropdown-menu">';
             $controls .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postName" style="margin-right: 10px;" ' . ($sort_by == 'postName' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['WooTitle'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postPrice" style="margin-right: 10px;" ' . ($sort_by == 'postPrice' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['WooPrice'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postRatings" style="margin-right: 10px;" ' . ($sort_by == 'postRatings' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['WooRating'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postDate" style="margin-right: 10px;" ' . ($sort_by == 'postDate' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['WooDate'] . '</label></li>';
             $controls .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postModified" style="margin-right: 10px;" ' . ($sort_by == 'postModified' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['WooModified'] . '</label></li>';
             $controls .= '</ul>';
             $controls .= '</div>';
         }
         $controls .= '</div>';
         $controls .= '<div class="clearFixMe" style="clear:both;"></div>';
         $controls .= '</div>';
         $closing .= '</div>';
         echo $opening;
         echo $controls;
         echo $products;
         echo $closing;
     }
     $myvariable = ob_get_clean();
     return $myvariable;
 }
コード例 #2
0
        function TS_VCSC_Posts_Slider_Standalone($atts, $content = null)
        {
            global $VISUAL_COMPOSER_EXTENSIONS;
            ob_start();
            wp_enqueue_style('dashicons');
            wp_enqueue_style('ts-font-ecommerce');
            wp_enqueue_style('ts-font-teammates');
            if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
                wp_enqueue_style('ts-extend-animations');
                wp_enqueue_style('ts-visual-composer-extend-front');
                wp_enqueue_script('ts-visual-composer-extend-front');
            }
            extract(shortcode_atts(array('post_type' => 'post', 'date_format' => 'F j, Y', 'datetime_translate' => 'true', 'time_format' => 'l, g:i A', 'limit_posts' => 'true', 'limit_by' => 'category', 'limit_term' => '', 'filter_menu' => 'true', 'layout_menu' => 'true', 'sort_menu' => 'false', 'directions_menu' => 'false', 'filter_by' => 'category', 'slider_type' => 'owlslider', 'posts_slide' => 4, 'auto_height' => 'false', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_playpause' => 'true', 'show_bar' => 'false', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'show_dots' => 'true', 'items_loop' => 'false', 'flex_navigation' => 'true', 'flex_animation' => 'slide', 'flex_margin' => 10, 'flex_breaks_single' => '240,480,720,960,1280,1600,1980', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'show_content' => 'excerpt', 'cutoff_characters' => 400, 'show_button' => 'true', 'content_read' => 'Read Post', 'content_target' => '_parent', 'show_featured' => 'true', 'show_share' => 'true', 'show_categories' => 'true', 'show_tags' => 'true', 'show_metadata' => 'true', 'show_avatar' => 'true', 'show_editlinks' => 'true', 'posts_limit' => 25, 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
            $postslider_random = mt_rand(999999, 9999999);
            $output = '';
            // Check for Front End Editor
            if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
                $slider_class = 'owl-carousel2-edit';
                $flex_class = 'flex-carousel-edit';
                $slider_message = '<div class="ts-composer-frontedit-message">' . __('The slider is currently viewed in front-end edit mode; slider features are disabled for performance and compatibility reasons.', "ts_visual_composer_extend") . '</div>';
                $product_style = 'width: ' . 100 / $posts_slide . '%; height: 100%; float: left; margin: 0; padding: 0;';
                $frontend_edit = 'true';
                $description_style = 'display: none;';
            } else {
                $slider_class = 'ts-owlslider-parent owl-carousel2';
                $flex_class = 'ts-flexslider-parent flex-carousel';
                $slider_message = '';
                $product_style = '';
                $frontend_edit = 'false';
                $description_style = 'display: none;';
            }
            if (!empty($el_id)) {
                $posts_container_id = $el_id;
            } else {
                $posts_container_id = 'ts-posts-slider-parent-' . $postslider_random;
            }
            $limit_term = str_replace(' ', '', $limit_term);
            if ($limit_by == 'category') {
                $limit_tax = 'category';
            } else {
                if ($limit_by == 'post_tag') {
                    $limit_tax = 'post_tag';
                } else {
                    if ($limit_by == 'cust_tax') {
                        $limit_tax = '';
                    }
                }
            }
            $filter_tax = '';
            // - set the taxonomy for the filter menu -
            if ($filter_by == 'category') {
                $menu_tax = 'category';
            } else {
                if ($filter_by == 'post_tag') {
                    $menu_tax = 'post_tag';
                } else {
                    if ($filter_by == 'cust_tax') {
                        $menu_tax = $filter_tax;
                    }
                }
            }
            // Set the WP Query Arguments
            $args = array('post_type' => $post_type, 'posts_per_page' => '-1');
            if ($limit_posts == 'true' && taxonomy_exists($limit_tax)) {
                $limited_terms = explode(',', $limit_term);
                $args['tax_query'] = array(array('taxonomy' => $limit_tax, 'field' => 'slug', 'terms' => $limited_terms, 'operator' => 'NOT IN'));
            }
            $isoposts = new WP_Query($args);
            // Language Settings: Isotope Posts
            $TS_VCSC_Isotope_Posts_Language = get_option('ts_vcsc_extend_settings_translationsIsotopePosts', '');
            if ($TS_VCSC_Isotope_Posts_Language == false || empty($TS_VCSC_Isotope_Posts_Language)) {
                $TS_VCSC_Isotope_Posts_Language = $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_Isotope_Posts_Language_Defaults;
            }
            if (function_exists('vc_shortcode_custom_css_class')) {
                $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Posts_Slider_Standalone', $atts);
            } else {
                $css_class = '';
            }
            if ($frontend_edit == 'true') {
                echo '<div id="ts-isotope-posts-grid-frontend-' . $postslider_random . '" class="ts-isotope-posts-grid-frontend" style="border: 1px solid #ededed; padding: 10px;">';
                echo '<div style="font-weight: bold;">"TS Posts Slider"</div>';
                echo '<div style="margin-bottom: 20px;">The element has been disabled in order to ensure compatiblity with the Visual Composer Front-End Editor.</div>';
                echo '<div>' . __("Exclude Categories", "ts_visual_composer_extend") . ': ' . $limit_posts . '</div>';
                if ($limit_posts == 'true') {
                    echo '<div>' . __("Excluded", "ts_visual_composer_extend") . ': ' . (empty($limit_term) ? __('None', "ts_visual_composer_extend") : $limit_term) . '</div>';
                }
                echo '<div>' . __("Number of Posts", "ts_visual_composer_extend") . ': ' . $posts_limit . '</div>';
                echo '<div>' . __("Max. Number of Posts per Slide", "ts_visual_composer_extend") . ': ' . $posts_slide . '</div>';
                $front_edit_reverse = array("excerpt" => __('Excerpt', "ts_visual_composer_extend"), "cutcharacters" => __('Character Limited Content', "ts_visual_composer_extend"), "complete" => __('Full Content', "ts_visual_composer_extend"));
                foreach ($front_edit_reverse as $key => $value) {
                    if ($key == $show_content) {
                        echo '<div>' . __("Content Length", "ts_visual_composer_extend") . ': ' . $value . '</div>';
                    }
                }
                echo '<div>' . __("Show 'Read Post' Button", "ts_visual_composer_extend") . ': ' . $show_button . '</div>';
                echo '<div>' . __("Show Featured Image", "ts_visual_composer_extend") . ': ' . $show_featured . '</div>';
                echo '<div>' . __("Show Share Buttons", "ts_visual_composer_extend") . ': ' . $show_share . '</div>';
                echo '<div>' . __("Show Categories", "ts_visual_composer_extend") . ': ' . $show_categories . '</div>';
                echo '<div>' . __("Show Tags", "ts_visual_composer_extend") . ': ' . $show_tags . '</div>';
                echo '<div>' . __("Show Metadata", "ts_visual_composer_extend") . ': ' . $show_metadata . '</div>';
                echo '<div>' . __("Show User Avatar", "ts_visual_composer_extend") . ': ' . $show_avatar . '</div>';
                echo '</div>';
            } else {
                if ($slider_type == "owlslider") {
                    wp_enqueue_style('ts-extend-owlcarousel2');
                    wp_enqueue_script('ts-extend-owlcarousel2');
                    echo '<div id="' . $posts_container_id . '-container" class="ts-postsslider-slider-container" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;">';
                    // Add Progressbar
                    if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
                        echo '<div id="ts-owlslider-progressbar-' . $postslider_random . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
                    }
                    // Add Navigation Controls
                    if ($frontend_edit == "false") {
                        echo '<div id="ts-owlslider-controls-' . $postslider_random . '" class="ts-owlslider-controls" style="' . ($auto_play == "true" && $show_playpause == "true" || $show_navigation == "true" ? "display: block;" : "display: none;") . '">';
                        echo '<div id="ts-owlslider-controls-next-' . $postslider_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-next"><span class="ts-ecommerce-arrowright5"></span></div>';
                        echo '<div id="ts-owlslider-controls-prev-' . $postslider_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-prev"><span class="ts-ecommerce-arrowleft5"></span></div>';
                        if ($auto_play == "true" && $show_playpause == "true") {
                            echo '<div id="ts-owlslider-controls-play-' . $postslider_random . '" class="ts-owlslider-controls-play active" style="' . ($show_playpause == "true" ? "display: block;" : "display: none;") . '"><span class="ts-ecommerce-pause"></span></div>';
                        }
                        echo '</div>';
                    }
                    // Add Slider
                    echo '<div id="' . $posts_container_id . '" class="ts-posts-slider-parent ts-postsslider ts-posts-owlslider ' . $slider_class . ' ' . $css_class . '" data-id="' . $postslider_random . '" data-items="' . $posts_slide . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-dots="' . $show_dots . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
                    // Create Individual Post Output
                    $postCounter = 0;
                    $postMonths = array();
                    if (post_type_exists($post_type) && $isoposts->have_posts()) {
                        while ($isoposts->have_posts()) {
                            $isoposts->the_post();
                            $matched_terms = 0;
                            /*if ($limit_posts == 'true') {
                            			$limited_terms 			= explode(',', $limit_term);
                            			$present_terms			= get_the_category();
                            			foreach ($present_terms as $category) {
                            				if (in_array(trim($category->slug), $limited_terms)) {
                            					$matched_terms++;
                            				}
                            			}
                            		}*/
                            if ($matched_terms == 0) {
                                $postCounter++;
                                if ($postCounter < $posts_limit + 1) {
                                    $postAttributes = 'data-visible="false" data-full="' . get_post_time($date_format) . '" data-author="' . get_the_author() . '" data-date="' . get_post_time('U') . '" data-modified="' . get_the_modified_time('U') . '" data-title="' . get_the_title() . '" data-comments="' . get_comments_number() . '" data-id="' . get_the_ID() . '"';
                                    ?>
											<div class="ts-postsslider-slide">
												<div class="ts-timeline-list-item ts-timeline-date-true ts-isotope-posts-list-item <?php 
                                    if ($filter_menu == 'true' && taxonomy_exists($menu_tax)) {
                                        foreach (get_the_terms($isoposts->post->ID, $menu_tax) as $term) {
                                            echo $term->slug . ' ';
                                        }
                                    }
                                    ?>
" <?php 
                                    echo $postAttributes;
                                    ?>
>
													<div class="ts-timeline-column">
														<div class="ts-timeline-text-wrap ts-timeline-text-wrap-date" style="position: relative;">
															<?php 
                                    // Post Date
                                    echo '<div class="ts-timeline-date"><span class="ts-timeline-date-connect"><span class="ts-timeline-date-text">';
                                    echo get_post_time($date_format, false, null, $datetime_translate == "true" ? true : false);
                                    echo '</span></span></div>';
                                    // Post Thumbnail
                                    if ($show_featured == "true") {
                                        if (strlen(get_the_post_thumbnail()) > 0 && strlen(get_post_thumbnail_id()) > 0) {
                                            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                                            ?>
																		<div class="ts-isotope-posts-thumb">
																			<a href="<?php 
                                            the_permalink();
                                            ?>
"><img src="<?php 
                                            echo $thumbnail[0];
                                            ?>
"></a>
																		</div>
																	<?php 
                                        }
                                    }
                                    ?>
															<h2 class="ts-isotope-posts-title" data-title="<?php 
                                    the_title();
                                    ?>
"><a href="<?php 
                                    the_permalink();
                                    ?>
"><?php 
                                    the_title();
                                    ?>
</a></h2>
															<div class="ts-isotope-posts-excerpt">
																<?php 
                                    if ($show_content == "excerpt") {
                                        the_excerpt();
                                    } else {
                                        if ($show_content == "cutcharacters") {
                                            $content = apply_filters('the_content', get_the_content());
                                            $excerpt = TS_VCSC_TruncateHTML($content, $cutoff_characters, '...', false, true);
                                            echo $excerpt;
                                        } else {
                                            if ($show_content == "complete") {
                                                the_content();
                                            }
                                        }
                                    }
                                    if ($show_button == 'true') {
                                        echo '<a class="ts-isotope-posts-connect" href="' . get_permalink() . '" target="' . $content_target . '">' . $content_read . '</a>';
                                    }
                                    ?>
															</div>
															<?php 
                                    if ($show_share == 'true') {
                                        $postTitle = get_the_title();
                                        echo '<div class="ts-isotope-posts-social">';
                                        echo '<a href="http://pinterest.com/pin/create/link/?url=' . get_permalink() . '&amp;description=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-pinterest"></span></a>';
                                        echo '<a href="https://plusone.google.com/_/+1/confirm?hl=en&amp;url=' . get_permalink() . '&amp;name=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-google"></span></a>';
                                        echo '<a href="http://twitter.com/share?text=' . $postTitle . '&url=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-twitter"></span></a>';
                                        echo '<a href="http://www.facebook.com/sharer.php?u=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-facebook"></span></a>';
                                        echo '</div>';
                                    }
                                    ?>
															<?php 
                                    if ($show_categories == 'true' || $show_tags == 'true') {
                                        echo '<div class="ts-isotope-posts-metadata clearFixMe">';
                                        // Post Categories
                                        if ($show_categories == 'true') {
                                            ?>
																		<div class="ts-isotope-posts-taxonomies">
																			<?php 
                                            $categories = get_the_category();
                                            $separator = ' / ';
                                            $output = '';
                                            if ($categories) {
                                                echo '<span class="ts-isotope-posts-taxonomies-title">' . $TS_VCSC_Isotope_Posts_Language['Categories'] . '<br/></span>';
                                                foreach ($categories as $category) {
                                                    $output .= '<a href="' . get_category_link($category->term_id) . '" class="ts-isotope-posts-categories" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . '</a>' . $separator;
                                                }
                                                echo trim($output, $separator);
                                            }
                                            ?>
																		</div>
																	<?php 
                                        }
                                        // Post Tags
                                        if ($show_tags == 'true') {
                                            ?>
																		<div class="ts-isotope-posts-keywords">
																			<?php 
                                            $posttags = get_the_tags();
                                            $separator = ' / ';
                                            $output = '';
                                            if ($posttags) {
                                                echo '<span class="ts-isotope-posts-keywords-title">' . $TS_VCSC_Isotope_Posts_Language['Tags'] . '<br/></span>';
                                                foreach ($posttags as $tag) {
                                                    $output .= '<a href="' . get_tag_link($tag->term_id) . '" class="ts-isotope-posts-tags" title="' . esc_attr(sprintf(__("View all posts in %s"), $tag->name)) . '">' . $tag->name . '</a>' . $separator;
                                                }
                                                echo trim($output, $separator);
                                            }
                                            ?>
																		</div>
																	<?php 
                                        }
                                        ?>
																</div>
															<?php 
                                    }
                                    // Post Time / Author / Type / Comments
                                    if ($show_metadata == 'true') {
                                        ?>
																<div class="ts-isotope-posts-metadata clearFixMe">
																	<?php 
                                        if ($show_avatar == 'true') {
                                            //echo '<div class="ts-isotope-posts-avatar">';
                                            echo get_avatar(get_the_author_meta('ID'), $size = '40');
                                            //echo '</div>';
                                        }
                                        ?>
																	<div class="ts-isotope-posts-author">
																		<?php 
                                        echo get_the_author();
                                        ?>
																	</div>
																	<?php 
                                        $format = get_post_format();
                                        if (false === $format) {
                                            $format = __('Standard', "ts_visual_composer_extend");
                                            $class = 'standard';
                                        } else {
                                            $class = strtolower($format);
                                        }
                                        echo '<div class="ts-isotope-posts-type ts-isotope-posts-type-' . $class . '">';
                                        echo ucfirst($format);
                                        echo '</div><br/>';
                                        ?>
																	<div class="ts-isotope-posts-time">
																		<?php 
                                        echo get_post_time($time_format, false, null, $datetime_translate == "true" ? true : false);
                                        ?>
																	</div>
																	<div class="ts-isotope-posts-comments">
																		<?php 
                                        echo get_comments_number();
                                        ?>
																	</div>
																</div>
															<?php 
                                    }
                                    // Edit Links
                                    if ($show_editlinks == 'true' && is_admin_bar_showing()) {
                                        echo '<div class="ts-isotope-posts-editlinks clearFixMe">';
                                        echo '<span class="ts-isotope-posts-edit"></span>';
                                        echo '<span class="ts-isotope-posts-links">';
                                        echo edit_post_link();
                                        echo '</span>';
                                        echo '</div>';
                                    }
                                    ?>
														</div>
													</div>
												</div>
											</div>
										<?php 
                                }
                            }
                        }
                        ?>
								<?php 
                        wp_reset_postdata();
                    } else {
                        echo '<p>Nothing found. Please check back soon!</p>';
                    }
                    echo '</div>';
                    echo '</div>';
                }
                if ($slider_type == "flexslider") {
                    wp_enqueue_style('ts-extend-flexslider2');
                    wp_enqueue_script('ts-extend-flexslider2');
                    if ($flex_animation == "fade") {
                        $posts_slide = 1;
                        $flex_margin = 0;
                    }
                    echo '<div id="' . $posts_container_id . '-container" class="ts-flexslider-container ts-posts-flexslider-container clearFixMe" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;" data-main="ts-posts-flexslider-main-' . $postslider_random . '" data-frontend="' . $frontend_edit . '" data-id="' . $postslider_random . '" data-count="" data-combo="false" data-thumbs="" data-images="" data-margin="' . $flex_margin . '" data-rtl="' . $page_rtl . '" data-navigation="' . $flex_navigation . '" data-animation="' . $flex_animation . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
                    // Add Progressbar
                    if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
                        echo '<div id="ts-flexslider-progressbar-container-' . $postslider_random . '" class="ts-flexslider-progressbar-container" style="width: 100%; height: 100%; background: #ededed;"><div id="ts-flexslider-progressbar-' . $postslider_random . '" class="ts-flexslider-progressbar" style="background: ' . $bar_color . '; height: 10px;"></div></div>';
                    }
                    // Add Slider (Main)
                    echo '<div id="ts-posts-flexslider-main-' . $postslider_random . '" class="' . $flex_class . ' ts-postsslider ts-posts-flexslider ts-posts-flexslider-main" data-id="' . $postslider_random . '" data-breaks="' . $flex_breaks_single . '">';
                    echo '<ul class="slides">';
                    // Create Individual Post Output
                    $postCounter = 0;
                    $postMonths = array();
                    if (post_type_exists($post_type) && $isoposts->have_posts()) {
                        while ($isoposts->have_posts()) {
                            $isoposts->the_post();
                            $matched_terms = 0;
                            /*if ($limit_posts == 'true') {
                            			$limited_terms 			= explode(',', $limit_term);
                            			$present_terms			= get_the_category();
                            			foreach ($present_terms as $category) {
                            				if (in_array(trim($category->slug), $limited_terms)) {
                            					$matched_terms++;
                            				}
                            			}
                            		}*/
                            if ($matched_terms == 0) {
                                $postCounter++;
                                if ($postCounter < $posts_limit + 1) {
                                    $postAttributes = 'data-visible="false" data-full="' . get_post_time($date_format) . '" data-author="' . get_the_author() . '" data-date="' . get_post_time('U') . '" data-modified="' . get_the_modified_time('U') . '" data-title="' . get_the_title() . '" data-comments="' . get_comments_number() . '" data-id="' . get_the_ID() . '"';
                                    ?>
												<li class="ts-postsslider-slide" style="margin: 0px <?php 
                                    echo $posts_slide == 1 || $page_rtl == "true" ? 0 : $flex_margin;
                                    ?>
px 0px <?php 
                                    echo $posts_slide == 1 || $page_rtl == "false" ? 0 : $flex_margin;
                                    ?>
px;" data-counter="<?php 
                                    echo $postCounter;
                                    ?>
">
													<div class="ts-timeline-list-item ts-timeline-date-true ts-isotope-posts-list-item <?php 
                                    if ($filter_menu == 'true' && taxonomy_exists($menu_tax)) {
                                        foreach (get_the_terms($isoposts->post->ID, $menu_tax) as $term) {
                                            echo $term->slug . ' ';
                                        }
                                    }
                                    ?>
" <?php 
                                    echo $postAttributes;
                                    ?>
>
														<div class="ts-timeline-column">
															<div class="ts-timeline-text-wrap ts-timeline-text-wrap-date" style="position: relative;">
																<?php 
                                    // Post Date
                                    echo '<div class="ts-timeline-date"><span class="ts-timeline-date-connect"><span class="ts-timeline-date-text">';
                                    echo get_post_time($date_format, false, null, $datetime_translate == "true" ? true : false);
                                    echo '</span></span></div>';
                                    // Post Thumbnail
                                    if ($show_featured == "true") {
                                        if ('' != get_the_post_thumbnail()) {
                                            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                                            ?>
																			<div class="ts-isotope-posts-thumb">
																				<a href="<?php 
                                            the_permalink();
                                            ?>
"><img src="<?php 
                                            echo $thumbnail[0];
                                            ?>
"></a>
																			</div>
																		<?php 
                                        }
                                    }
                                    ?>
																<h2 class="ts-isotope-posts-title" data-title="<?php 
                                    the_title();
                                    ?>
"><a href="<?php 
                                    the_permalink();
                                    ?>
"><?php 
                                    the_title();
                                    ?>
</a></h2>
																<div class="ts-isotope-posts-excerpt">
																	<?php 
                                    if ($show_content == "excerpt") {
                                        the_excerpt();
                                    } else {
                                        if ($show_content == "cutcharacters") {
                                            $content = apply_filters('the_content', get_the_content());
                                            $excerpt = TS_VCSC_TruncateHTML($content, $cutoff_characters, '...', false, true);
                                            echo $excerpt;
                                        } else {
                                            if ($show_content == "complete") {
                                                the_content();
                                            }
                                        }
                                    }
                                    if ($show_button == 'true') {
                                        echo '<a class="ts-isotope-posts-connect" href="' . get_permalink() . '" target="' . $content_target . '">' . $content_read . '</a>';
                                    }
                                    ?>
																</div>
																<?php 
                                    if ($show_share == 'true') {
                                        $postTitle = get_the_title();
                                        echo '<div class="ts-isotope-posts-social">';
                                        echo '<a href="http://pinterest.com/pin/create/link/?url=' . get_permalink() . '&amp;description=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-pinterest"></span></a>';
                                        echo '<a href="https://plusone.google.com/_/+1/confirm?hl=en&amp;url=' . get_permalink() . '&amp;name=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-google"></span></a>';
                                        echo '<a href="http://twitter.com/share?text=' . $postTitle . '&url=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-twitter"></span></a>';
                                        echo '<a href="http://www.facebook.com/sharer.php?u=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-facebook"></span></a>';
                                        echo '</div>';
                                    }
                                    ?>
																<?php 
                                    if ($show_categories == 'true' || $show_tags == 'true') {
                                        echo '<div class="ts-isotope-posts-metadata clearFixMe">';
                                        // Post Categories
                                        if ($show_categories == 'true') {
                                            ?>
																			<div class="ts-isotope-posts-taxonomies">
																				<?php 
                                            $categories = get_the_category();
                                            $separator = ' / ';
                                            $output = '';
                                            if ($categories) {
                                                echo '<span class="ts-isotope-posts-taxonomies-title">' . $TS_VCSC_Isotope_Posts_Language['Categories'] . '<br/></span>';
                                                foreach ($categories as $category) {
                                                    $output .= '<a href="' . get_category_link($category->term_id) . '" class="ts-isotope-posts-categories" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . '</a>' . $separator;
                                                }
                                                echo trim($output, $separator);
                                            }
                                            ?>
																			</div>
																		<?php 
                                        }
                                        // Post Tags
                                        if ($show_tags == 'true') {
                                            ?>
																			<div class="ts-isotope-posts-keywords">
																				<?php 
                                            $posttags = get_the_tags();
                                            $separator = ' / ';
                                            $output = '';
                                            if ($posttags) {
                                                echo '<span class="ts-isotope-posts-keywords-title">' . $TS_VCSC_Isotope_Posts_Language['Tags'] . '<br/></span>';
                                                foreach ($posttags as $tag) {
                                                    $output .= '<a href="' . get_tag_link($tag->term_id) . '" class="ts-isotope-posts-tags" title="' . esc_attr(sprintf(__("View all posts in %s"), $tag->name)) . '">' . $tag->name . '</a>' . $separator;
                                                }
                                                echo trim($output, $separator);
                                            }
                                            ?>
																			</div>
																		<?php 
                                        }
                                        ?>
																	</div>
																<?php 
                                    }
                                    // Post Time / Author / Type / Comments
                                    if ($show_metadata == 'true') {
                                        ?>
																	<div class="ts-isotope-posts-metadata clearFixMe">
																		<?php 
                                        if ($show_avatar == 'true') {
                                            //echo '<div class="ts-isotope-posts-avatar">';
                                            echo get_avatar(get_the_author_meta('ID'), $size = '40');
                                            //echo '</div>';
                                        }
                                        ?>
																		<div class="ts-isotope-posts-author">
																			<?php 
                                        echo get_the_author();
                                        ?>
																		</div>
																		<?php 
                                        $format = get_post_format();
                                        if (false === $format) {
                                            $format = __('Standard', "ts_visual_composer_extend");
                                            $class = 'standard';
                                        } else {
                                            $class = strtolower($format);
                                        }
                                        echo '<div class="ts-isotope-posts-type ts-isotope-posts-type-' . $class . '">';
                                        echo ucfirst($format);
                                        echo '</div><br/>';
                                        ?>
																		<div class="ts-isotope-posts-time">
																			<?php 
                                        echo get_post_time($time_format, false, null, $datetime_translate == "true" ? true : false);
                                        ?>
																		</div>
																		<div class="ts-isotope-posts-comments">
																			<?php 
                                        echo get_comments_number();
                                        ?>
																		</div>
																	</div>
																<?php 
                                    }
                                    // Edit Links
                                    if ($show_editlinks == 'true' && is_admin_bar_showing()) {
                                        echo '<div class="ts-isotope-posts-editlinks clearFixMe">';
                                        echo '<span class="ts-isotope-posts-edit"></span>';
                                        echo '<span class="ts-isotope-posts-links">';
                                        echo edit_post_link();
                                        echo '</span>';
                                        echo '</div>';
                                    }
                                    ?>
															</div>
														</div>
													</div>
												</li>
											<?php 
                                }
                            }
                        }
                        ?>
									<?php 
                        wp_reset_postdata();
                    } else {
                        echo '<p>Nothing found. Please check back soon!</p>';
                    }
                    echo '</ul>';
                    // Add Play/Pause Control
                    if ($auto_play == "true" && $show_playpause == "true") {
                        echo '<div id="ts-flexslider-controls-' . $postslider_random . '" class="ts-flexslider-controls" style="display: none;">';
                        echo '<div id="ts-flexslider-controls-play-' . $postslider_random . '" class="ts-flexslider-controls-play active"><span class="ts-ecommerce-pause"></span></div>';
                        echo '</div>';
                    }
                    echo '</div>';
                    echo '</div>';
                }
            }
            $myvariable = ob_get_clean();
            return $myvariable;
        }
コード例 #3
0
        function TS_VCSC_Posts_Grid_Standalone($atts, $content = null)
        {
            global $VISUAL_COMPOSER_EXTENSIONS;
            ob_start();
            if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == 'false') {
                if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
                    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
                        wp_enqueue_style('ts-visual-composer-extend-front');
                    }
                } else {
                    wp_enqueue_style('ts-extend-dropdown');
                    wp_enqueue_script('ts-extend-dropdown');
                    wp_enqueue_style('ts-font-teammates');
                    wp_enqueue_style('dashicons');
                    if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndForcable == "false") {
                        wp_enqueue_style('ts-extend-buttons');
                        wp_enqueue_style('ts-visual-composer-extend-front');
                        wp_enqueue_script('ts-extend-isotope');
                        wp_enqueue_script('ts-visual-composer-extend-front');
                    }
                    add_action('wp_footer', array($this, 'TS_VCSC_Posts_Grid_Function_Isotope'), 9999);
                }
            }
            extract(shortcode_atts(array('post_type' => 'post', 'date_format' => 'F j, Y', 'datetime_translate' => 'true', 'time_format' => 'l, g:i A', 'limit_posts' => 'true', 'limit_by' => 'category', 'limit_term' => '', 'filter_menu' => 'true', 'layout_menu' => 'true', 'sort_menu' => 'false', 'directions_menu' => 'false', 'filter_by' => 'category', 'layout' => 'masonry', 'column_width' => 275, 'layout_break' => 600, 'show_periods' => 'false', 'sort_by' => 'postDate', 'sort_order' => 'desc', 'show_content' => 'excerpt', 'cutoff_characters' => 400, 'show_button' => 'true', 'content_read' => 'Read Post', 'content_target' => '_parent', 'show_featured' => 'true', 'show_share' => 'true', 'show_categories' => 'true', 'show_tags' => 'true', 'show_metadata' => 'true', 'show_avatar' => 'true', 'show_editlinks' => 'true', 'posts_limit' => 25, 'posts_lazy' => 'false', 'posts_ajax' => 10, 'posts_load' => 'Show More', 'posts_trigger' => 'click', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
            $postsgrid_random = mt_rand(999999, 9999999);
            $output = '';
            if (!empty($el_id)) {
                $posts_container_id = $el_id;
            } else {
                $posts_container_id = 'ts-isotope-posts-grid-parent-' . $postsgrid_random;
            }
            $limit_term = str_replace(' ', '', $limit_term);
            if ($limit_by == 'category') {
                $limit_tax = 'category';
            } else {
                if ($limit_by == 'post_tag') {
                    $limit_tax = 'post_tag';
                } else {
                    if ($limit_by == 'cust_tax') {
                        $limit_tax = '';
                    }
                }
            }
            $filter_tax = '';
            // - set the taxonomy for the filter menu -
            if ($filter_by == 'category') {
                $menu_tax = 'category';
            } else {
                if ($filter_by == 'post_tag') {
                    $menu_tax = 'post_tag';
                } else {
                    if ($filter_by == 'cust_tax') {
                        $menu_tax = $filter_tax;
                    }
                }
            }
            // Set the WP Query Arguments
            $args = array('post_type' => $post_type, 'posts_per_page' => '-1');
            if ($limit_posts == 'true' && taxonomy_exists($limit_tax)) {
                $limited_terms = explode(',', $limit_term);
                $args['tax_query'] = array(array('taxonomy' => $limit_tax, 'field' => 'slug', 'terms' => $limited_terms, 'operator' => 'NOT IN'));
            }
            $isoposts = new WP_Query($args);
            /*
            // Listing of all Registered Post Types (Standard + Custom)
            $post_types = get_post_types( '', 'names' ); 
            foreach ( $post_types as $post_type ) {
            	$post_obj = get_post_type_object($post_type);
            	echo '<p>' . $post_obj->labels->singular_name . ' / ' . $post_type . '</p>';
            }
            // Categories for Custom Post Type
            $customPostTaxonomies = get_object_taxonomies('ts_team');
            if (count($customPostTaxonomies) > 0) {
            	foreach ($customPostTaxonomies as $tax) {
            		$args = array(
            			'orderby' 			=> 'name',
            			'show_count' 		=> 0,
            			'pad_counts' 		=> 0,
            			'hierarchical' 		=> 1,
            			'taxonomy' 			=> $tax,
            			'title_li' 			=> ''
            		);
            		$categories = get_categories($args);
            		foreach($categories as $category) { 
            			echo '<span>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name . '</a></span> ';
            			echo '<span> Slug: '. $category->slug . ' / Post Count: '. $category->count . ' / Cat ID: ' . $category->cat_ID . ' / Term ID: ' . $category->term_id . ' / Tax ID: ' . $category->term_taxonomy_id . '</span><br/>';
            		} 
            	}
            }
            */
            // Language Settings: Isotope Posts
            $TS_VCSC_Isotope_Posts_Language = get_option('ts_vcsc_extend_settings_translationsIsotopePosts', '');
            if ($TS_VCSC_Isotope_Posts_Language == false || empty($TS_VCSC_Isotope_Posts_Language)) {
                $TS_VCSC_Isotope_Posts_Language = $VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_Isotope_Posts_Language_Defaults;
            }
            if (function_exists('vc_shortcode_custom_css_class')) {
                $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Posts_Grid_Standalone', $atts);
            } else {
                $css_class = '';
            }
            if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == 'false') {
                $isotope_posts_list_class = 'ts-posts-timeline-view';
            } else {
                $isotope_posts_list_class = 'ts-posts-timeline-edit';
            }
            if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == 'true') {
                echo '<div id="ts-isotope-posts-grid-frontend-' . $postsgrid_random . '" class="ts-isotope-posts-grid-frontend" style="border: 1px solid #ededed; padding: 10px;">';
                echo '<div style="font-weight: bold;">"TS Isotope Posts"</div>';
                echo '<div style="margin-bottom: 20px;">The element has been disabled in order to ensure compatiblity with the Visual Composer Front-End Editor.</div>';
                echo '<div>' . __("Exclude Categories", "ts_visual_composer_extend") . ': ' . $limit_posts . '</div>';
                if ($limit_posts == 'true') {
                    echo '<div>' . __("Excluded", "ts_visual_composer_extend") . ': ' . (empty($limit_term) ? __('None', "ts_visual_composer_extend") : $limit_term) . '</div>';
                }
                echo '<div>' . __("Number of Posts", "ts_visual_composer_extend") . ': ' . $posts_limit . '</div>';
                $front_edit_reverse = array("excerpt" => __('Excerpt', "ts_visual_composer_extend"), "cutcharacters" => __('Character Limited Content', "ts_visual_composer_extend"), "complete" => __('Full Content', "ts_visual_composer_extend"));
                foreach ($front_edit_reverse as $key => $value) {
                    if ($key == $show_content) {
                        echo '<div>' . __("Content Length", "ts_visual_composer_extend") . ': ' . $value . '</div>';
                    }
                }
                echo '<div>' . __("Show 'Read Post' Button", "ts_visual_composer_extend") . ': ' . $show_button . '</div>';
                $front_edit_reverse = array("spineTimeline" => __('Timeline', "ts_visual_composer_extend"), "masonry" => __('Centered Masonry', "ts_visual_composer_extend"), "fitRows" => __('Fit Rows', "ts_visual_composer_extend"), "straightDown" => __('Straight Down', "ts_visual_composer_extend"));
                foreach ($front_edit_reverse as $key => $value) {
                    if ($key == $layout) {
                        echo '<div>' . __("Layout", "ts_visual_composer_extend") . ': ' . $value . '</div>';
                    }
                }
                $front_edit_reverse = array("postDate" => __('Post Date', "ts_visual_composer_extend"), "postModified" => __('Post Modified', "ts_visual_composer_extend"), "postName" => __('Post Name', "ts_visual_composer_extend"), "postAuthor" => __('Post Author', "ts_visual_composer_extend"), "postID" => __('Post ID', "ts_visual_composer_extend"), "postComments" => __('Number of Comments', "ts_visual_composer_extend"));
                foreach ($front_edit_reverse as $key => $value) {
                    if ($key == $sort_by) {
                        echo '<div>' . __("Sort Criterion", "ts_visual_composer_extend") . ': ' . $value . '</div>';
                    }
                }
                $front_edit_reverse = array("asc" => __('Bottom to Top', "ts_visual_composer_extend"), "desc" => __('Top to Bottom', "ts_visual_composer_extend"));
                foreach ($front_edit_reverse as $key => $value) {
                    if ($key == $sort_order) {
                        echo '<div>' . __("Initial Order", "ts_visual_composer_extend") . ': ' . $value . '</div>';
                    }
                }
                echo '<div>' . __("Show Filter Button", "ts_visual_composer_extend") . ': ' . $filter_menu . '</div>';
                echo '<div>' . __("Show Layout Button", "ts_visual_composer_extend") . ': ' . $layout_menu . '</div>';
                echo '<div>' . __("Show Sort Criterion Button", "ts_visual_composer_extend") . ': ' . $sort_menu . '</div>';
                echo '<div>' . __("Show Directions Buttons", "ts_visual_composer_extend") . ': ' . $directions_menu . '</div>';
                echo '</div>';
            } else {
                echo '<div id="' . $posts_container_id . '" class="ts-isotope-posts-grid-parent ' . ($layout == 'spineTimeline' ? 'ts-timeline ' : 'ts-postsgrid ') . 'ts-timeline-' . $sort_order . ' ts-posts-timeline ' . $isotope_posts_list_class . ' ' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . ';" data-lazy="' . $posts_lazy . '" data-count="' . $posts_limit . '" data-ajax="' . $posts_ajax . '" data-trigger="' . $posts_trigger . '" data-column="' . $column_width . '" data-layout="' . $layout . '" data-sort="' . $sort_by . '" data-order="' . $sort_order . '" data-break="' . $layout_break . '" data-type="' . $post_type . '">';
                // Create Post Controls (Filter, Sort)
                echo '<div id="ts-isotope-posts-grid-controls-' . $postsgrid_random . '" class="ts-isotope-posts-grid-controls">';
                if ($directions_menu == 'true' && $posts_lazy == 'false') {
                    echo '<div class="ts-button ts-button-flat ts-timeline-controls-desc ts-isotope-posts-controls-desc ' . ($sort_order == "desc" ? "active" : "") . '"><span class="ts-isotope-posts-controls-desc-image"></span></div>';
                    echo '<div class="ts-button ts-button-flat ts-timeline-controls-asc ts-isotope-posts-controls-asc ' . ($sort_order == "asc" ? "active" : "") . '"><span class="ts-isotope-posts-controls-asc-image"></span></div>';
                }
                echo '<div class="ts-isotope-posts-grid-controls-menus">';
                if ($filter_menu == 'true' && taxonomy_exists($menu_tax)) {
                    if ($menu_tax == $limit_tax && $limit_posts == 'true') {
                        global $wpdb;
                        $limited_terms = explode(',', $limit_term);
                        $excluded_ids = array();
                        foreach ($limited_terms as $limitedterm) {
                            $term_id = $wpdb->get_var("SELECT term_id FROM {$wpdb->terms} WHERE slug='{$limitedterm}'");
                            $excluded_ids[] = $term_id;
                        }
                        $id_string = implode(' ', $excluded_ids);
                    } else {
                        $id_string = '';
                    }
                    $terms = get_terms($menu_tax, array('exclude' => $id_string));
                    $count = count($terms);
                    if ($count > 0) {
                        $output .= '<div id="ts-isotope-posts-filter-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-filter-trigger" data-dropdown="#ts-isotope-posts-filter-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['ButtonFilter'] . '</span></div>';
                        $output .= '<div id="ts-isotope-posts-filter-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
                        $output .= '<ul id="" class="ts-dropdown-menu">';
                        $output .= '<li><label style="font-weight: bold;"><input class="ts-isotope-posts-filter ts-isotope-posts-filter-all" type="checkbox" style="margin-right: 10px;" checked="checked" data-type="all" data-key="' . $postsgrid_random . '" data-filter="*">' . $TS_VCSC_Isotope_Posts_Language['SeeAll'] . '</label></li>';
                        $output .= '<li class="ts-dropdown-divider"></li>';
                        foreach ($terms as $term) {
                            $output .= '<li><label><input class="ts-isotope-posts-filter ts-isotope-posts-filter-single" type="checkbox" style="margin-right: 10px;" data-type="single" data-key="' . $postsgrid_random . '" data-filter=".' . $term->slug . '">' . $term->name . '</label></li>';
                        }
                        $output .= '</ul>';
                        $output .= '</div>';
                    }
                }
                if ($layout_menu == 'true') {
                    $output .= '<div id="ts-isotope-posts-layout-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-layout-trigger" data-dropdown="#ts-isotope-posts-layout-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['ButtonLayout'] . '</span></div>';
                    $output .= '<div id="ts-isotope-posts-layout-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
                    $output .= '<ul id="" class="ts-dropdown-menu">';
                    $output .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="masonry" style="margin-right: 10px;" ' . ($layout == 'masonry' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Masonry'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="spineTimeline" style="margin-right: 10px;" ' . ($layout == 'spineTimeline' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Timeline'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="fitRows" style="margin-right: 10px;" ' . ($layout == 'fitRows' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['FitRows'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-layout" type="radio" name="radio-group-' . $postsgrid_random . '" data-layout="straightDown" style="margin-right: 10px;" ' . ($layout == 'straightDown' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['StraightDown'] . '</label></li>';
                    $output .= '</ul>';
                    $output .= '</div>';
                }
                if ($sort_menu == 'true') {
                    $output .= '<div id="ts-isotope-posts-sort-trigger-' . $postsgrid_random . '" class="ts-isotope-posts-sort-trigger" data-dropdown="#ts-isotope-posts-sort-' . $postsgrid_random . '" data-horizontal-offset="0" data-vertical-offset="0"><span>' . $TS_VCSC_Isotope_Posts_Language['ButtonSort'] . '</span></div>';
                    $output .= '<div id="ts-isotope-posts-sort-' . $postsgrid_random . '" class="ts-dropdown ts-dropdown-tip ts-dropdown-relative ts-dropdown-anchor-left" style="left: 0px;">';
                    $output .= '<ul id="" class="ts-dropdown-menu">';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postDate" style="margin-right: 10px;" ' . ($sort_by == 'postDate' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Date'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postModified" style="margin-right: 10px;" ' . ($sort_by == 'postModified' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Modified'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postName" style="margin-right: 10px;" ' . ($sort_by == 'postName' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Title'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postAuthor" style="margin-right: 10px;" ' . ($sort_by == 'postAuthor' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Author'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postID" style="margin-right: 10px;" ' . ($sort_by == 'postID' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['PostID'] . '</label></li>';
                    $output .= '<li><label><input class="ts-isotope-posts-sort" type="radio" name="radio-sort-' . $postsgrid_random . '" data-sort="postComments" style="margin-right: 10px;" ' . ($sort_by == 'postComments' ? 'checked="checked"' : '') . '>' . $TS_VCSC_Isotope_Posts_Language['Comments'] . '</label></li>';
                    $output .= '</ul>';
                    $output .= '</div>';
                }
                echo $output;
                echo '</div>';
                echo '<div class="clearFixMe" style="clear:both;"></div>';
                echo '</div>';
                // Create Individual Post Output
                $postCounter = 0;
                $postMonths = array();
                if (post_type_exists($post_type) && $isoposts->have_posts()) {
                    ?>
						<div class="ts-timeline-content">
							<div id="ts-timeline-spine-<?php 
                    echo $postsgrid_random;
                    ?>
" class="ts-timeline-spine ts-posts-spine-layout-<?php 
                    echo $layout;
                    ?>
"></div>
							<ul id="ts-isotope-posts-grid-<?php 
                    echo $postsgrid_random;
                    ?>
" class="ts-isotope-posts-grid ts-timeline-list" data-layout="<?php 
                    echo $layout;
                    ?>
" data-key="<?php 
                    echo $postsgrid_random;
                    ?>
">
								<?php 
                    while ($isoposts->have_posts()) {
                        $isoposts->the_post();
                        $matched_terms = 0;
                        /*if ($limit_posts == 'true') {
                        			$limited_terms 			= explode(',', $limit_term);
                        			$present_terms			= get_the_category();
                        			foreach ($present_terms as $category) {
                        				if (in_array(trim($category->slug), $limited_terms)) {
                        					$matched_terms++;
                        				}
                        			}
                        		}*/
                        if ($matched_terms == 0) {
                            $postCounter++;
                            if ($postCounter < $posts_limit + 1) {
                                if ($show_periods == 'true') {
                                    $postPeriod = get_post_time('F Y');
                                    if (!in_array($postPeriod, $postMonths)) {
                                        array_push($postMonths, $postPeriod);
                                        $breakMonth = get_post_time('n');
                                        $breakYear = get_post_time('Y');
                                        $breakStart = mktime(0, 0, 1, $breakMonth, 1, $breakYear);
                                        $breakEnd = mktime(23, 59, 59, $breakMonth, cal_days_in_month(CAL_GREGORIAN, $breakMonth, $breakYear), $breakYear);
                                        $output = '';
                                        $output .= '<li class="ts-timeline-list-item ts-timeline-break ts-timeline-list-supress" style="" data-visible="false" data-full="Break: ' . $postPeriod . '" data-date="' . ($sort_order == "asc" ? $breakStart : $breakEnd) . '" data-start="' . $breakStart . '" data-end="' . $breakEnd . '">';
                                        $output .= '<div class="ts-timeline-column" style="margin: 0;">';
                                        $output .= '<div class="ts-timeline-text-wrap" style="">';
                                        $output .= '<div class="ts-timeline-text-wrap-inner" style="width: 100%; left: 0;">';
                                        $output .= '<h3 class="ts-timeline-title" style="text-align: center; margin: 0; padding: 0;">' . $postPeriod . '</h3>';
                                        $output .= '</div>';
                                        $output .= '<div class="clearFixMe"></div>';
                                        $output .= '</div>';
                                        $output .= '</div>';
                                        $output .= '</li>';
                                        echo $output;
                                    }
                                }
                                $postAttributes = 'data-visible="false" data-full="' . get_post_time($date_format) . '" data-author="' . get_the_author() . '" data-date="' . get_post_time('U') . '" data-modified="' . get_the_modified_time('U') . '" data-title="' . get_the_title() . '" data-comments="' . get_comments_number() . '" data-id="' . get_the_ID() . '"';
                                ?>
										<li class="ts-timeline-list-item ts-timeline-date-true ts-isotope-posts-list-item <?php 
                                if ($filter_menu == 'true' && taxonomy_exists($menu_tax)) {
                                    foreach (get_the_terms($isoposts->post->ID, $menu_tax) as $term) {
                                        echo $term->slug . ' ';
                                    }
                                }
                                ?>
" <?php 
                                echo $postAttributes;
                                ?>
>
											<div class="ts-timeline-column">
												<div class="ts-timeline-text-wrap ts-timeline-text-wrap-date" style="">
													<?php 
                                // Post Date
                                echo '<div class="ts-timeline-date"><span class="ts-timeline-date-connect"><span class="ts-timeline-date-text">';
                                echo get_post_time($date_format, false, null, $datetime_translate == "true" ? true : false);
                                echo '</span></span></div>';
                                // Post Thumbnail
                                if ($show_featured == "true") {
                                    if (strlen(get_the_post_thumbnail()) > 0 && strlen(get_post_thumbnail_id()) > 0) {
                                        $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                                        ?>
																<div class="ts-isotope-posts-thumb">
																	<a href="<?php 
                                        the_permalink();
                                        ?>
"><img src="<?php 
                                        echo $thumbnail[0];
                                        ?>
"></a>
																</div>
															<?php 
                                    }
                                }
                                ?>
													<h2 class="ts-isotope-posts-title" data-title="<?php 
                                the_title();
                                ?>
"><a href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a></h2>
													<div class="ts-isotope-posts-excerpt">
														<?php 
                                if ($show_content == "excerpt") {
                                    the_excerpt();
                                } else {
                                    if ($show_content == "cutcharacters") {
                                        $content = apply_filters('the_content', get_the_content());
                                        $excerpt = TS_VCSC_TruncateHTML($content, $cutoff_characters, '...', false, true);
                                        echo $excerpt;
                                    } else {
                                        if ($show_content == "complete") {
                                            the_content();
                                        }
                                    }
                                }
                                if ($show_button == 'true') {
                                    echo '<a class="ts-isotope-posts-connect" href="' . get_permalink() . '" target="' . $content_target . '">' . $content_read . '</a>';
                                }
                                ?>
													</div>
													<?php 
                                if ($show_share == 'true') {
                                    $postTitle = get_the_title();
                                    echo '<div class="ts-isotope-posts-social">';
                                    echo '<a href="http://pinterest.com/pin/create/link/?url=' . get_permalink() . '&amp;description=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-pinterest"></span></a>';
                                    echo '<a href="https://plusone.google.com/_/+1/confirm?hl=en&amp;url=' . get_permalink() . '&amp;name=' . $postTitle . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-google"></span></a>';
                                    echo '<a href="http://twitter.com/share?text=' . $postTitle . '&url=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-twitter"></span></a>';
                                    echo '<a href="http://www.facebook.com/sharer.php?u=' . get_permalink() . '" class="ts-isotope-posts-social-holder" rel="external" target="_blank"><span class="ts-isotope-posts-social-facebook"></span></a>';
                                    echo '</div>';
                                }
                                ?>
													<?php 
                                if ($show_categories == 'true' || $show_tags == 'true') {
                                    echo '<div class="ts-isotope-posts-metadata clearFixMe">';
                                    // Post Categories
                                    if ($show_categories == 'true') {
                                        ?>
																<div class="ts-isotope-posts-taxonomies">
																	<?php 
                                        $categories = get_the_category();
                                        $separator = ' / ';
                                        $output = '';
                                        if ($categories) {
                                            echo '<span class="ts-isotope-posts-taxonomies-title">' . $TS_VCSC_Isotope_Posts_Language['Categories'] . ':<br/></span>';
                                            foreach ($categories as $category) {
                                                $output .= '<a href="' . get_category_link($category->term_id) . '" class="ts-isotope-posts-categories" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . '</a>' . $separator;
                                            }
                                            echo trim($output, $separator);
                                        }
                                        ?>
																</div>
															<?php 
                                    }
                                    // Post Tags
                                    if ($show_tags == 'true') {
                                        ?>
																<div class="ts-isotope-posts-keywords">
																	<?php 
                                        $posttags = get_the_tags();
                                        $separator = ' / ';
                                        $output = '';
                                        if ($posttags) {
                                            echo '<span class="ts-isotope-posts-keywords-title">' . $TS_VCSC_Isotope_Posts_Language['Tags'] . ':<br/></span>';
                                            foreach ($posttags as $tag) {
                                                $output .= '<a href="' . get_tag_link($tag->term_id) . '" class="ts-isotope-posts-tags" title="' . esc_attr(sprintf(__("View all posts in %s"), $tag->name)) . '">' . $tag->name . '</a>' . $separator;
                                            }
                                            echo trim($output, $separator);
                                        }
                                        ?>
																</div>
															<?php 
                                    }
                                    ?>
														</div>
													<?php 
                                }
                                // Post Time / Author / Type / Comments
                                if ($show_metadata == 'true') {
                                    ?>
														<div class="ts-isotope-posts-metadata clearFixMe">
															<?php 
                                    if ($show_avatar == 'true') {
                                        //echo '<div class="ts-isotope-posts-avatar">';
                                        echo get_avatar(get_the_author_meta('ID'), $size = '40');
                                        //echo '</div>';
                                    }
                                    ?>
															<div class="ts-isotope-posts-author">
																<?php 
                                    echo get_the_author();
                                    ?>
															</div>
															<?php 
                                    $format = get_post_format();
                                    if (false === $format) {
                                        $format = __('Standard', "ts_visual_composer_extend");
                                        $class = 'standard';
                                    } else {
                                        $class = strtolower($format);
                                    }
                                    echo '<div class="ts-isotope-posts-type ts-isotope-posts-type-' . $class . '">';
                                    echo ucfirst($format);
                                    echo '</div><br/>';
                                    ?>
															<div class="ts-isotope-posts-time">
																<?php 
                                    echo get_post_time($time_format, false, null, $datetime_translate == "true" ? true : false);
                                    ?>
															</div>
															<div class="ts-isotope-posts-comments">
																<?php 
                                    echo get_comments_number();
                                    ?>
															</div>
														</div>
													<?php 
                                }
                                // Edit Links
                                if ($show_editlinks == 'true' && is_admin_bar_showing()) {
                                    echo '<div class="ts-isotope-posts-editlinks clearFixMe">';
                                    echo '<span class="ts-isotope-posts-edit"></span>';
                                    echo '<span class="ts-isotope-posts-links">';
                                    echo edit_post_link();
                                    echo '</span>';
                                    echo '</div>';
                                }
                                ?>
												</div>
											</div>
										</li>
									<?php 
                            }
                        }
                    }
                    ?>
							</ul>
						</div>
						<?php 
                    if ($posts_lazy == "true") {
                        echo '<div class="ts-load-more-wrap">';
                        echo '<span class="ts-timeline-load-more">' . $posts_load . '</span>';
                        echo '</div>';
                    }
                    wp_reset_postdata();
                } else {
                    echo '<p>Nothing found. Please check back soon!</p>';
                }
                echo '</div>';
            }
            $myvariable = ob_get_clean();
            return $myvariable;
        }
コード例 #4
0
 function TS_VCSC_WooCommerce_Slider_Basic_Function($atts, $content = null)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     global $product;
     global $woocommerce;
     ob_start();
     wp_enqueue_script('ts-extend-hammer');
     wp_enqueue_script('ts-extend-nacho');
     wp_enqueue_style('ts-extend-nacho');
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_LoadFrontEndWaypoints == "true") {
         if (wp_script_is('waypoints', $list = 'registered')) {
             wp_enqueue_script('waypoints');
         } else {
             wp_enqueue_script('ts-extend-waypoints');
         }
     }
     wp_enqueue_style('ts-extend-owlcarousel2');
     wp_enqueue_script('ts-extend-owlcarousel2');
     wp_enqueue_style('ts-font-ecommerce');
     wp_enqueue_style('ts-extend-animations');
     wp_enqueue_style('ts-visual-composer-extend-front');
     wp_enqueue_script('ts-visual-composer-extend-front');
     extract(shortcode_atts(array('selection' => 'recent_products', 'category' => '', 'ids' => '', 'orderby' => 'date', 'order' => 'desc', 'products_total' => 12, 'exclude_outofstock' => 'false', 'show_image' => 'true', 'link_page' => 'false', 'link_target' => '_parent', 'show_rating' => 'true', 'show_stock' => 'true', 'show_price' => 'true', 'show_link' => 'true', 'show_cart' => 'true', 'show_info' => 'true', 'show_content' => 'excerpt', 'cutoff_characters' => 400, 'products_slide' => 4, 'breakpoints_custom' => 'false', 'breakpoints_items' => '1,2,3,4,5,6,7,8', 'auto_height' => 'false', 'page_rtl' => 'false', 'auto_play' => 'false', 'show_bar' => 'false', 'bar_color' => '#dd3333', 'show_speed' => 5000, 'stop_hover' => 'true', 'show_navigation' => 'true', 'show_dots' => 'true', 'items_loop' => 'false', 'animation_in' => 'ts-viewport-css-flipInX', 'animation_out' => 'ts-viewport-css-slideOutDown', 'animation_mobile' => 'false', 'lightbox_group_name' => 'nachogroup', 'lightbox_size' => 'full', 'lightbox_effect' => 'random', 'lightbox_speed' => 5000, 'lightbox_social' => 'true', 'lightbox_backlight_choice' => 'predefined', 'lightbox_backlight_color' => '#0084E2', 'lightbox_backlight_custom' => '#000000', 'image_position' => 'ts-imagefloat-center', 'hover_type' => 'ts-imagehover-style1', 'hover_active' => 'false', 'overlay_trigger' => 'ts-trigger-hover', 'rating_maximum' => 5, 'rating_value' => 0, 'rating_quarter' => 'true', 'rating_dynamic' => '', 'rating_size' => 16, 'rating_auto' => 'false', 'rating_rtl' => 'false', 'rating_symbol' => 'other', 'rating_icon' => 'ts-ecommerce-starfull1', 'color_rated' => '#FFD800', 'color_empty' => '#e3e3e3', 'caption_show' => 'false', 'caption_position' => 'left', 'caption_digits' => '.', 'caption_danger' => '#d9534f', 'caption_warning' => '#f0ad4e', 'caption_info' => '#5bc0de', 'caption_primary' => '#428bca', 'caption_success' => '#5cb85c', 'margin_top' => 0, 'margin_bottom' => 0, 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     $woo_random = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $woo_slider_id = $el_id;
     } else {
         $woo_slider_id = 'ts-vcsc-woocommerce-slider-' . $woo_random;
     }
     $output = '';
     // Backlight Color
     if ($lightbox_backlight_choice == "predefined") {
         $lightbox_backlight_selection = $lightbox_backlight_color;
     } else {
         $lightbox_backlight_selection = $lightbox_backlight_custom;
     }
     // Check for Front End Editor
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $slider_class = 'owl-carousel2-edit';
         $slider_message = '<div class="ts-composer-frontedit-message">' . __('The slider is currently viewed in front-end edit mode; slider features are disabled for performance and compatibility reasons.', "ts_visual_composer_extend") . '</div>';
         $product_style = 'width: ' . 100 / $products_slide . '%; height: 100%; float: left; margin: 0; padding: 0;';
         $frontend_edit = 'true';
         $description_style = 'display: none; padding: 15px;';
     } else {
         $slider_class = 'ts-owlslider-parent owl-carousel2';
         $slider_message = '';
         $product_style = '';
         $frontend_edit = 'false';
         $description_style = 'display: none; padding: 15px;';
     }
     $meta_query = '';
     // Recent Products
     if ($selection == "recent_products") {
         $meta_query = WC()->query->get_meta_query();
     }
     // Featured Products
     if ($selection == "featured_products") {
         $meta_query = array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'), array('key' => '_featured', 'value' => 'yes'));
     }
     // Top Rated Products
     if ($selection == "top_rated_products") {
         add_filter('posts_clauses', array(WC()->query, 'order_by_rating_post_clauses'));
         $meta_query = WC()->query->get_meta_query();
     }
     // Final Query Arguments
     $args = array('post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $frontend_edit == "true" ? $products_slide : $products_total, 'orderby' => $orderby, 'order' => $order, 'paged' => 1, 'meta_query' => $meta_query);
     // Products on Sale
     if ($selection == "sale_products") {
         $product_ids_on_sale = woocommerce_get_product_ids_on_sale();
         $meta_query = array();
         $meta_query[] = $woocommerce->query->visibility_meta_query();
         $meta_query[] = $woocommerce->query->stock_status_meta_query();
         $args['meta_query'] = $meta_query;
         $args['post__in'] = $product_ids_on_sale;
     }
     // Best Selling Products
     if ($selection == "best_selling_products") {
         $args['meta_key'] = 'total_sales';
         $args['orderby'] = 'meta_value_num';
         $args['meta_query'] = array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'));
     }
     // Products in Single Category
     if ($selection == "product_category") {
         $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => array(esc_attr($category)), 'field' => 'slug', 'operator' => 'IN'));
     }
     // Products in Multiple Categories
     if ($selection == "product_categories") {
         $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => explode(",", $ids), 'field' => 'term_id', 'operator' => 'IN'));
     }
     // Start WordPress Query
     $loop = new WP_Query($args);
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $slider_class . ' ' . $el_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_WooCommerce_Slider_Basic', $atts);
     } else {
         $css_class = $slider_class . ' ' . $el_class;
     }
     $output .= '<div id="' . $woo_slider_id . '-container" class="ts-woocommerce-slider-container">';
     // Add Progressbar
     if ($auto_play == "true" && $show_bar == "true" && $frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-progressbar-' . $woo_random . '" class="ts-owlslider-progressbar-holder" style=""><div class="ts-owlslider-progressbar" style="background: ' . $bar_color . '; height: 100%; width: 0%;"></div></div>';
     }
     // Add Navigation Controls
     if ($frontend_edit == "false") {
         $output .= '<div id="ts-owlslider-controls-' . $woo_random . '" class="ts-owlslider-controls" style="' . ($auto_play == "true" || $show_navigation == "true" ? "display: block;" : "display: none;") . '">';
         $output .= '<div id="ts-owlslider-controls-next-' . $woo_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-next"><span class="ts-ecommerce-arrowright5"></span></div>';
         $output .= '<div id="ts-owlslider-controls-prev-' . $woo_random . '" style="' . ($show_navigation == "true" ? "display: block;" : "display: none;") . '" class="ts-owlslider-controls-prev"><span class="ts-ecommerce-arrowleft5"></span></div>';
         if ($auto_play == "true") {
             $output .= '<div id="ts-owlslider-controls-play-' . $woo_random . '" class="ts-owlslider-controls-play active"><span class="ts-ecommerce-pause"></span></div>';
         }
         $output .= '</div>';
     }
     // Front-Edit Message
     if ($frontend_edit == "true") {
         $output .= $slider_message;
     }
     // Add Slider
     $output .= '<div id="' . $woo_slider_id . '" class="' . $css_class . '" style="margin-top: ' . $margin_top . 'px; margin-bottom: ' . $margin_bottom . 'px;" data-id="' . $woo_random . '" data-items="' . $products_slide . '" data-breakpointscustom="' . $breakpoints_custom . '" data-breakpointitems="' . $breakpoints_items . '" data-rtl="' . $page_rtl . '" data-loop="' . $items_loop . '" data-navigation="' . $show_navigation . '" data-dots="' . $show_dots . '" data-mobile="' . $animation_mobile . '" data-animationin="' . $animation_in . '" data-animationout="' . $animation_out . '" data-height="' . $auto_height . '" data-play="' . $auto_play . '" data-bar="' . $show_bar . '" data-color="' . $bar_color . '" data-speed="' . $show_speed . '" data-hover="' . $stop_hover . '">';
     if ($loop->have_posts()) {
         while ($loop->have_posts()) {
             $loop->the_post();
             $product_id = get_the_ID();
             $product_title = get_the_title($product_id);
             $post = get_post($product_id);
             $product = new WC_Product($product_id);
             $attachment_ids = $product->get_gallery_attachment_ids();
             $price = $product->get_price_html();
             $product_sku = $product->get_sku();
             $attributes = $product->get_attributes();
             $stock = $product->is_in_stock() ? 'true' : 'false';
             $onsale = $product->is_on_sale() ? 'true' : 'false';
             // Rating Settings
             $rating_html = $product->get_rating_html();
             $rating = $product->get_average_rating();
             if ($rating == '') {
                 $rating = 0;
             }
             if ($rating_quarter == "true") {
                 $rating_value = floor($rating * 4) / 4;
             } else {
                 $rating_value = $rating;
             }
             $rating_value = number_format($rating_value, 2, $caption_digits, '');
             if ($rating_rtl == "false") {
                 $rating_width = $rating_value / $rating_maximum * 100;
             } else {
                 $rating_width = 100 - $rating_value / $rating_maximum * 100;
             }
             if ($rating_symbol == "other") {
                 if ($rating_icon == "ts-ecommerce-starfull1") {
                     $rating_class = 'ts-rating-stars-star1';
                 } else {
                     if ($rating_icon == "ts-ecommerce-starfull2") {
                         $rating_class = 'ts-rating-stars-star2';
                     } else {
                         if ($rating_icon == "ts-ecommerce-starfull3") {
                             $rating_class = 'ts-rating-stars-star3';
                         } else {
                             if ($rating_icon == "ts-ecommerce-starfull4") {
                                 $rating_class = 'ts-rating-stars-star4';
                             } else {
                                 if ($rating_icon == "ts-ecommerce-heartfull") {
                                     $rating_class = 'ts-rating-stars-heart1';
                                 } else {
                                     if ($rating_icon == "ts-ecommerce-heart") {
                                         $rating_class = 'ts-rating-stars-heart2';
                                     } else {
                                         if ($rating_icon == "ts-ecommerce-thumbsup") {
                                             $rating_class = 'ts-rating-stars-thumb';
                                         } else {
                                             if ($rating_icon == "ts-ecommerce-ribbon4") {
                                                 $rating_class = 'ts-rating-stars-ribbon';
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             } else {
                 $rating_class = 'ts-rating-stars-smile';
             }
             if ($rating_value >= 0 && $rating_value <= 1) {
                 $caption_class = 'ts-label-danger';
                 $caption_background = 'background-color: ' . $caption_danger . ';';
             } else {
                 if ($rating_value > 1 && $rating_value <= 2) {
                     $caption_class = 'ts-label-warning';
                     $caption_background = 'background-color: ' . $caption_warning . ';';
                 } else {
                     if ($rating_value > 2 && $rating_value <= 3) {
                         $caption_class = 'ts-label-info';
                         $caption_background = 'background-color: ' . $caption_info . ';';
                     } else {
                         if ($rating_value > 3 && $rating_value <= 4) {
                             $caption_class = 'ts-label-primary';
                             $caption_background = 'background-color: ' . $caption_primary . ';';
                         } else {
                             if ($rating_value > 4 && $rating_value <= 5) {
                                 $caption_class = 'ts-label-success';
                                 $caption_background = 'background-color: ' . $caption_success . ';';
                             }
                         }
                     }
                 }
             }
             if (has_post_thumbnail($loop->post->ID)) {
                 $featured = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                 $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');
                 $featured = $featured[0];
                 $thumbnail = $thumbnail[0];
             } else {
                 $featured = woocommerce_placeholder_img_src();
                 $thumbnail = $featured;
             }
             $title = get_the_title();
             if ($exclude_outofstock == "true" && $stock == "true" || $exclude_outofstock == "false") {
                 $output .= '<div class="ts-woocommerce-product-slide" style="' . $product_style . '" data-hash="' . $product_id . '">';
                 $output .= '<div id="ts-woocommerce-product-' . $product_id . '" class="ts-image-hover-frame ' . $image_position . ' ts-trigger-hover-adjust" style="width: 100%;">';
                 $output .= '<div id="ts-woocommerce-product-' . $product_id . '-counter" class="ts-fluid-wrapper " style="width: 100%; height: auto;">';
                 $output .= '<div id="ts-woocommerce-product-' . $product_id . '-mask" class="ts-imagehover ' . $hover_type . ' ts-trigger-hover" data-trigger="ts-trigger-hover" data-closer="" style="width: 100%; height: auto;">';
                 // Product Thumbnail
                 $output .= '<div class="ts-woocommerce-product-preview">';
                 $output .= '<img class="ts-woocommerce-product-image" src="' . $featured . '" alt="" />';
                 $output .= '</div>';
                 // Sale Ribbon
                 if ($onsale == "true") {
                     $output .= '<div class="ts-woocommerce-product-ribbon"></div>';
                     $output .= '<i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-sale ts-ecommerce-tagsale"></i>';
                 }
                 $output .= '<div class="ts-woocommerce-product-main">';
                 $output .= '<div class="mask" style="width: 100%; display: block;">';
                 $output .= '<div id="ts-woocommerce-product-' . $product_id . '-maskcontent" class="maskcontent" style="margin: 0; padding: 0;">';
                 // Product Thubmnail
                 if ($show_image == "true") {
                     if ($link_page == "false") {
                         $output .= '<div class="ts-woocommerce-link-wrapper"><a id="" class="nch-lightbox-media no-ajaxy" data-title="' . $title . '" rel="" href="' . $featured . '" target="' . $link_target . '">';
                         $output .= '<div class="ts-woocommerce-product-thumbnail" style="background-image: url(' . $thumbnail . ');"></div>';
                         $output .= '</a></div>';
                     } else {
                         $output .= '<div class="ts-woocommerce-link-wrapper"><a id="" class="" data-title="' . $title . '" rel="" href="' . get_permalink() . '" target="' . $link_target . '">';
                         $output .= '<div class="ts-woocommerce-product-thumbnail" style="background-image: url(' . $thumbnail . ');"></div>';
                         $output .= '</a></div>';
                     }
                 }
                 // Product Page Link
                 if ($show_link == "true") {
                     $output .= '<div class="ts-woocommerce-link-wrapper"><a href="' . get_permalink() . '" class="ts-woocommerce-product-link" target="' . $link_target . '"><i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-view ts-ecommerce-forward"></i></a></div>';
                 }
                 // Product Rating
                 if ($show_rating == "true") {
                     $output .= '<div class="ts-rating-stars-frame" data-auto="' . $rating_auto . '" data-size="' . $rating_size . '" data-width="' . $rating_size * 5 . '" data-rating="' . $rating_value . '" style="margin: 10px 0 0 10px; float: left;">';
                     $output .= '<div class="ts-star-rating' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-active " style="font-size: ' . $rating_size . 'px; line-height: ' . ($rating_size + 5) . 'px;">';
                     if ($caption_show == "true" && $caption_position == "left") {
                         $output .= '<div class="ts-rating-caption" style="margin-right: 10px;">';
                         if ($rating_rtl == "false") {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                         } else {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                         }
                         $output .= '</div>';
                     }
                     $output .= '<div class="ts-rating-container' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-glyph-holder ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_empty : $color_rated) . ';">';
                     $output .= '<div class="ts-rating-stars ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_rated : $color_empty) . '; width: ' . $rating_width . '%;"></div>';
                     $output .= '</div>';
                     if ($caption_show == "true" && $caption_position == "right") {
                         $output .= '<div class="ts-rating-caption" style="margin-left: 10px;">';
                         if ($rating_rtl == "false") {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                         } else {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                         }
                         $output .= '</div>';
                     }
                     $output .= '</div>';
                     $output .= '</div>';
                 }
                 // Product Price
                 if ($show_price == "true") {
                     $output .= '<div class="ts-woocommerce-product-price">';
                     $output .= '<i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-cost ts-ecommerce-pricetag3"></i>';
                     if ($product->price > 0) {
                         if ($product->price && isset($product->regular_price)) {
                             $from = $product->regular_price;
                             $to = $product->price;
                             if ($from != $to) {
                                 $output .= '<div class="ts-woocommerce-product-regular"><del>' . (is_numeric($from) ? woocommerce_price($from) : $from) . '</del> | </div><div class="ts-woocommerce-product-special">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             } else {
                                 $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             }
                         } else {
                             $to = $product->price;
                             $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                         }
                     } else {
                         $to = $product->price;
                         $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                     }
                     $output .= '</div>';
                 }
                 $output .= '<div class="ts-woocommerce-product-line"></div>';
                 // Add to Cart Button (Icon)
                 if ($show_cart == "true") {
                     $output .= '<div class="ts-woocommerce-link-wrapper"><a class="ts-woocommerce-product-purchase" href="?add-to-cart=' . $product_id . '" rel="nofollow" data-id="' . $product_id . '" data-sku="' . $product_sku . '"><i style="" class="ts-woocommerce-product-icon ts-woocommerce-product-cart ts-ecommerce-cart4"></i></a></div>';
                 }
                 // View Description Button
                 if ($show_info == "true") {
                     $output .= '<div id="ts-vcsc-modal-' . $product_id . '-trigger" style="" class="ts-vcsc-modal-' . $product_id . '-parent nch-holder ts-vcsc-font-icon ts-font-icons ts-shortcode ts-icon-align-center" style="">';
                     $output .= '<a href="#ts-vcsc-modal-' . $product_id . '" class="nch-lightbox-modal" data-title="" data-open="false" data-delay="0" data-type="html" rel="" data-effect="' . $lightbox_effect . '" data-share="0" data-duration="' . $lightbox_speed . '" data-color="' . $lightbox_backlight_selection . '">';
                     $output .= '<span class="">';
                     $output .= '<i class="ts-font-icon ts-woocommerce-product-icon ts-woocommerce-product-info ts-ecommerce-information1" style=""></i>';
                     $output .= '</span>';
                     $output .= '</a>';
                     $output .= '</div>';
                 }
                 // Product In-Stock or Unavailable
                 if ($show_stock == "true") {
                     $output .= '<div class="ts-woocommerce-product-status">';
                     if ($stock == 'false') {
                         $output .= '<div class="ts-woocommerce-product-stock"><span class="ts-woocommerce-product-outofstock">' . __('Out of Stock', 'woocommerce') . '</span></div>';
                     } else {
                         if ($stock == 'true') {
                             $output .= '<div class="ts-woocommerce-product-stock"><span class="ts-woocommerce-product-instock">' . __('In Stock', 'woocommerce') . '</span></div>';
                         }
                     }
                     $output .= '</div>';
                 }
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
                 $output .= '</div>';
                 // Product Title
                 $output .= '<h2 class="ts-woocommerce-product-title">';
                 $output .= $title;
                 $output .= '</h2>';
                 // Product Description
                 if ($show_info == "true") {
                     $output .= '<div id="ts-vcsc-modal-' . $product_id . '" class="ts-modal-content nch-hide-if-javascript" style="' . $description_style . '">';
                     $output .= '<div class="ts-modal-white-header"></div>';
                     $output .= '<div class="ts-modal-white-frame">';
                     $output .= '<div class="ts-modal-white-inner">';
                     $output .= '<h2 style="border-bottom: 1px solid #eeeeee; padding-bottom: 10px; line-height: 32px; font-size: 24px; text-align: left;">' . $title . '</h2>';
                     $output .= '<div class="ts-woocommerce-lightbox-frame" style="width: 100%; height: 32px; margin: 10px auto; padding: 0;">';
                     $output .= '<a style="position: inherit; margin-left: 10px; float: right;" class="ts-woocommerce-product-purchase" href="?add-to-cart=' . $product_id . '" rel="nofollow" data-id="' . $product_id . '" data-sku="' . $product_sku . '"><i style="color: #000000;" class="ts-woocommerce-product-icon ts-woocommerce-product-cart ts-ecommerce-cart4"></i></a>';
                     $output .= '<a href="' . get_permalink() . '" target="_parent" style="position: inherit; margin-left: 10px; float: right;" class="ts-woocommerce-product-link"><i style="color: #000000;" class="ts-woocommerce-product-icon ts-woocommerce-product-view ts-ecommerce-forward"></i></a>';
                     $output .= '<div class="ts-rating-stars-frame" data-auto="' . $rating_auto . '" data-size="' . $rating_size . '" data-width="' . $rating_size * 5 . '" data-rating="' . $rating_value . '" style="margin: 0; float: right;">';
                     $output .= '<div class="ts-star-rating' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-active " style="font-size: ' . $rating_size . 'px; line-height: ' . ($rating_size + 5) . 'px;">';
                     if ($caption_show == "true" && $caption_position == "left") {
                         $output .= '<div class="ts-rating-caption" style="margin-right: 10px;">';
                         if ($rating_rtl == "false") {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                         } else {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                         }
                         $output .= '</div>';
                     }
                     $output .= '<div class="ts-rating-container' . ($rating_rtl == "false" ? "" : "-rtl") . ' ts-rating-glyph-holder ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_empty : $color_rated) . ';">';
                     $output .= '<div class="ts-rating-stars ' . $rating_class . '" style="color: ' . ($rating_rtl == "false" ? $color_rated : $color_empty) . '; width: ' . $rating_width . '%;"></div>';
                     $output .= '</div>';
                     if ($caption_show == "true" && $caption_position == "right") {
                         $output .= '<div class="ts-rating-caption" style="margin-left: 10px;">';
                         if ($rating_rtl == "false") {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . $rating_value . ' / ' . number_format($rating_maximum, 2, $caption_digits, '') . '</span>';
                         } else {
                             $output .= '<span class="label ' . $caption_class . '" style="' . $caption_background . '">' . number_format($rating_maximum, 2, $caption_digits, '') . ' / ' . $rating_value . '</span>';
                         }
                         $output .= '</div>';
                     }
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '<div class="ts-woocommerce-product-price" style="position: inherit; margin-right: 10px; float: left; width: auto; margin-top: 0;">';
                     $output .= '<i style="color: #000000; margin: 0 10px 0 0;" class="ts-woocommerce-product-icon ts-woocommerce-product-cost ts-ecommerce-pricetag3"></i>';
                     if ($product->price > 0) {
                         if ($product->price && isset($product->regular_price)) {
                             $from = $product->regular_price;
                             $to = $product->price;
                             if ($from != $to) {
                                 $output .= '<div class="ts-woocommerce-product-regular"><del style="color: #7F0000;">' . (is_numeric($from) ? woocommerce_price($from) : $from) . '</del> | </div><div class="ts-woocommerce-product-special">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             } else {
                                 $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                             }
                         } else {
                             $to = $product->price;
                             $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                         }
                     } else {
                         $to = $product->price;
                         $output .= '<div class="ts-woocommerce-product-current">' . (is_numeric($to) ? woocommerce_price($to) : $to) . '</div>';
                     }
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '<div class="ts-woocommerce-product-seperator" style="border-bottom: 1px solid #eeeeee; margin: 10px auto 20px auto; width: 100%;"></div>';
                     $output .= '<img style="width: 100%; max-width: 250px; height: auto; margin: 10px auto;" class="ts-woocommerce-product-image" src="' . $featured . '" alt="" />';
                     $output .= '<div class="ts-woocommerce-product-seperator" style="border-bottom: 1px solid #eeeeee; margin: 20px auto 10px auto; width: 100%;"></div>';
                     $output .= '<div style="margin-top: 20px; text-align: justify;">';
                     if ($show_content == "excerpt") {
                         $output .= get_the_excerpt();
                     } else {
                         if ($show_content == "cutcharacters") {
                             $content = apply_filters('the_content', get_the_content());
                             $excerpt = TS_VCSC_TruncateHTML($content, $cutoff_characters, '...', false, true);
                             $output .= $excerpt;
                         } else {
                             if ($show_content == "complete") {
                                 $output .= get_the_content();
                             }
                         }
                     }
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '</div>';
                     $output .= '</div>';
                 }
                 $output .= '</div>';
             }
         }
     } else {
         echo __("No products could be found.", "ts_visual_composer_extend");
     }
     $output .= '</div>';
     $output .= '</div>';
     wp_reset_postdata();
     wp_reset_query();
     echo $output;
     $myvariable = ob_get_clean();
     return $myvariable;
 }
コード例 #5
0
 function TS_VCSC_Posts_Timeline_Standalone($atts)
 {
     global $VISUAL_COMPOSER_EXTENSIONS;
     ob_start();
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "false") {
         wp_enqueue_style('ts-extend-csstimeline');
         wp_enqueue_script('ts-extend-csstimeline');
         wp_enqueue_script('ts-extend-hammer');
         wp_enqueue_script('ts-extend-nacho');
         wp_enqueue_style('ts-extend-nacho');
         wp_enqueue_style('ts-font-ecommerce');
         wp_enqueue_style('ts-font-teammates');
         wp_enqueue_style('dashicons');
         wp_enqueue_style('ts-extend-tooltipster');
         wp_enqueue_script('ts-extend-tooltipster');
         wp_enqueue_style('ts-extend-buttonsdual');
         wp_enqueue_script('ts-visual-composer-extend-front');
     }
     extract(shortcode_atts(array('post_type' => 'post', 'date_format' => 'F j, Y', 'datetime_translate' => 'true', 'time_format' => 'l, g:i A', 'limit_posts' => 'true', 'limit_by' => 'category', 'limit_term' => '', 'filter_by' => 'category', 'posts_limit' => 25, 'content_show' => 'excerpt', 'content_cutoff' => 400, 'button_show' => 'true', 'button_text' => 'Read Post', 'button_target' => '_blank', 'button_style' => 'ts-dual-buttons-color-default', 'button_hover' => 'ts-dual-buttons-preview-default ts-dual-buttons-hover-default', 'button_width' => 100, 'show_periods' => 'true', 'show_date' => 'true', 'show_featured' => 'true', 'show_share' => 'true', 'show_categories' => 'true', 'show_tags' => 'true', 'show_metadata' => 'true', 'show_avatar' => 'true', 'show_editlinks' => 'true', 'featured_link' => 'lightbox', 'lightbox_effect' => 'random', 'lightbox_speed' => 5000, 'lightbox_backlight' => 'auto', 'lightbox_backlight_color' => '#ffffff', 'timeline_order' => 'desc', 'timeline_sort' => 'true', 'timeline_sort_by' => 'postDate', 'timeline_sort_label' => 'Sort Posts:', 'timeline_sort_asc' => 'Ascending', 'timeline_sort_desc' => 'Descending', 'timeline_lazy' => 'false', 'timeline_trigger' => 'scroll', 'timeline_count' => '10', 'timeline_break' => '600', 'timeline_layout' => 'ts-timeline-css-columns', 'timeline_switch' => 'ts-timeline-css-responsive', 'timeline_title_text' => '', 'timeline_title_color' => '#7c7979', 'timeline_load' => 'Load More', 'timeline_filter_allow' => 'true', 'timeline_filter_cats' => 'true', 'timeline_filter_tags' => 'true', 'timeline_filter_labelcats' => 'Filter By Categories:', 'timeline_filter_labeltags' => 'Filter By Tags:', 'timeline_filter_nocats' => 'No Categories', 'timeline_filter_notags' => 'No Tags', 'timeline_filter_breaks' => 'Timeline Periods', 'timeline_filter_selected' => 'Selected', 'timeline_filter_selectall' => 'Select All', 'margin_bottom' => '0', 'margin_top' => '0', 'el_id' => '', 'el_class' => '', 'css' => ''), $atts));
     if ($timeline_filter_allow == "true" && $timeline_filter_cats == "false" && $timeline_filter_tags == "false") {
         $timeline_filter_allow = "false";
     }
     if ($timeline_filter_allow == "true" || $timeline_sort == "true") {
         wp_enqueue_style('ts-extend-sumo');
         wp_enqueue_script('ts-extend-sumo');
     }
     $timeline_random = mt_rand(999999, 9999999);
     if (!empty($el_id)) {
         $timeline_container_id = $el_id;
     } else {
         $timeline_container_id = 'ts-vcsc-timeline-css-container-' . $timeline_random;
     }
     $output = '';
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $vcinline_class = 'ts-timeline-css-edit';
         $vcinline_note = '<div class="ts-composer-frontedit-message">' . __('This timeline is currently viewed in Visual Composer front-end editor mode. It is advised to edit such a complex element in back-end edit mode in order to avoid potential conflicts with other files loaded on the front-end of your website. The timeline is not functional in order to ensure display compatibility with the front-end editor.', "ts_visual_composer_extend") . '</div>';
         $vcinline_margin = 35;
         $vcinline_controls = 'false';
         $timeline_lazy = 'false';
     } else {
         $vcinline_class = 'ts-timeline-css-view';
         $vcinline_note = '';
         $vcinline_margin = $margin_top;
         $vcinline_controls = 'true';
         $timeline_lazy = $timeline_lazy;
     }
     $timeline_class = 'ts-timeline-css-container-' . str_replace("ts-timeline-css-", "", $timeline_layout);
     // Post Query
     $limit_term = str_replace(' ', '', $limit_term);
     if ($limit_by == 'category') {
         $limit_tax = 'category';
     } else {
         if ($limit_by == 'post_tag') {
             $limit_tax = 'post_tag';
         } else {
             if ($limit_by == 'cust_tax') {
                 $limit_tax = '';
             }
         }
     }
     $filter_tax = '';
     // - set the taxonomy for the filter menu -
     if ($filter_by == 'category') {
         $menu_tax = 'category';
     } else {
         if ($filter_by == 'post_tag') {
             $menu_tax = 'post_tag';
         } else {
             if ($filter_by == 'cust_tax') {
                 $menu_tax = $filter_tax;
             }
         }
     }
     // Set the WP Query Arguments
     $args = array('post_type' => $post_type, 'posts_per_page' => '-1');
     if ($limit_posts == 'true' && taxonomy_exists($limit_tax)) {
         $limited_terms = explode(',', $limit_term);
         $args['tax_query'] = array(array('taxonomy' => $limit_tax, 'field' => 'slug', 'terms' => $limited_terms, 'operator' => 'NOT IN'));
     }
     $timelineposts = new WP_Query($args);
     // Lightbox Settings
     if ($lightbox_backlight == "auto") {
         $nacho_color = '';
     } else {
         if ($lightbox_backlight == "custom") {
             $nacho_color = 'data-color="' . $lightbox_backlight_color . '"';
         } else {
             if ($lightbox_backlight == "hideit") {
                 $nacho_color = 'data-color="rgba(0, 0, 0, 0)"';
             }
         }
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         $vc_inline = 'true';
         $vc_inline_style = ' display: block;';
     } else {
         $vc_inline = 'false';
         $vc_inline_style = '';
     }
     if ($timeline_filter_allow == "true") {
         $timeline_filter_data = 'data-filter-allow="' . $timeline_filter_allow . '" data-filter-categories="' . $timeline_filter_cats . '" data-filter-tags="' . $timeline_filter_tags . '" data-filter-nocats="' . $timeline_filter_nocats . '" data-filter-notags="' . $timeline_filter_notags . '" data-filter-selected="' . $timeline_filter_selected . '" data-filter-selectall="' . $timeline_filter_selectall . '"';
     } else {
         $timeline_filter_data = 'data-filter-allow="' . $timeline_filter_allow . '"';
     }
     if (function_exists('vc_shortcode_custom_css_class')) {
         $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'ts-timeline-css-container ts-timeline-css-container-' . $timeline_order . ' clearFixMe ' . $el_class . ' ' . $vcinline_class . ' ' . vc_shortcode_custom_css_class($css, ' '), 'TS_VCSC_Timeline_CSS_Container', $atts);
     } else {
         $css_class = 'ts-timeline-css-container ts-timeline-css-container-' . $timeline_order . ' clearFixMe ' . $el_class . ' ' . $vcinline_class;
     }
     if ($VISUAL_COMPOSER_EXTENSIONS->TS_VCSC_VCFrontEditMode == "true") {
         echo '<div id="ts-isotope-posts-grid-frontend-' . $timeline_random . '" class="ts-isotope-posts-grid-frontend" style="border: 1px solid #ededed; padding: 10px;">';
         echo '<div style="font-weight: bold;">"TS Posts Timeline"</div>';
         echo '<div style="margin-bottom: 20px;">The element has been disabled in order to ensure compatiblity with the Visual Composer Front-End Editor.</div>';
         echo '<div>' . __("Exclude Categories", "ts_visual_composer_extend") . ': ' . $limit_posts . '</div>';
         if ($limit_posts == 'true') {
             echo '<div>' . __("Excluded", "ts_visual_composer_extend") . ': ' . (empty($limit_term) ? __('None', "ts_visual_composer_extend") : $limit_term) . '</div>';
         }
         echo '<div>' . __("Number of Posts", "ts_visual_composer_extend") . ': ' . $posts_limit . '</div>';
         $front_edit_reverse = array("excerpt" => __('Excerpt', "ts_visual_composer_extend"), "cutcharacters" => __('Character Limited Content', "ts_visual_composer_extend"), "complete" => __('Full Content', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $content_show) {
                 echo '<div>' . __("Content Length", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         echo '<div>' . __("Show 'Read Post' Button", "ts_visual_composer_extend") . ': ' . $button_show . '</div>';
         $front_edit_reverse = array("asc" => __('Bottom to Top', "ts_visual_composer_extend"), "desc" => __('Top to Bottom', "ts_visual_composer_extend"));
         foreach ($front_edit_reverse as $key => $value) {
             if ($key == $timeline_order) {
                 echo '<div>' . __("Initial Order", "ts_visual_composer_extend") . ': ' . $value . '</div>';
             }
         }
         echo '</div>';
     } else {
         echo '<div id="' . $timeline_container_id . '" class="' . $css_class . ' ' . $timeline_class . '" data-type="posts" data-layout="' . $timeline_layout . '" ' . $timeline_filter_data . ' data-sorter="' . $timeline_sort . '" data-switch="' . $timeline_switch . '" data-order="' . $timeline_order . '" data-lazy="' . $timeline_lazy . '" data-count="' . $timeline_count . '" data-trigger="' . $timeline_trigger . '" data-break="' . $timeline_break . '" style="margin-top: ' . $vcinline_margin . 'px; margin-bottom: ' . $margin_bottom . 'px; width: 100%;">';
         echo $vcinline_note;
         // Filter Controls
         if ($timeline_filter_allow == "true" && ($timeline_filter_cats == "true" || $timeline_filter_tags == "true")) {
             // Categories Filter
             if ($timeline_filter_cats == "true") {
                 echo '<div id="ts-timeline-css-filters-cats-' . $timeline_random . '" class="ts-timeline-css-filters-cats ts-timeline-css-filters" data-random="' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '" style="display: none;">';
                 echo '<label class="ts-timeline-css-filters-cats-label" style="display: inline-block; margin-left: 0;" for="ts-timeline-css-filters-cats-sections-' . $timeline_random . '">' . $timeline_filter_labelcats . '</label>';
                 echo '<select id="ts-timeline-css-filters-cats-sections-' . $timeline_random . '" class="ts-timeline-css-filters-cats-sections" multiple="multiple" data-option="ts-timeline-css-filters-cats-sections-' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '"></select>';
                 echo '</div>';
             }
             // Tags Filter
             if ($timeline_filter_tags == "true") {
                 echo '<div id="ts-timeline-css-filters-tags-' . $timeline_random . '" class="ts-timeline-css-filters-tags ts-timeline-css-filters" data-random="' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '" style="display: none;">';
                 echo '<label class="ts-timeline-css-filters-tags-label" style="display: inline-block; margin-left: 0;" for="ts-timeline-css-filters-tags-sections-' . $timeline_random . '">' . $timeline_filter_labeltags . '</label>';
                 echo '<select id="ts-timeline-css-filters-tags-sections-' . $timeline_random . '" class="ts-timeline-css-filters-tags-sections" multiple="multiple" data-option="ts-timeline-css-filters-tags-sections-' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '"></select>';
                 echo '</div>';
             }
         }
         // Sorter Controls
         if ($timeline_sort == "true" && $vcinline_controls == "true") {
             echo '<div id="ts-timeline-css-sorter-' . $timeline_random . '" class="ts-timeline-css-sorter" data-random="' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '" style="display: none;">';
             echo '<label class="ts-timeline-css-sorter-label" style="display: inline-block; margin-left: 0;" for="ts-timeline-css-filters-tags-sections-' . $timeline_random . '">' . $timeline_sort_label . '</label>';
             echo '<select id="ts-timeline-css-sorter-sections-' . $timeline_random . '" class="ts-timeline-css-sorter-sections" data-option="ts-timeline-css-sorter-sections-' . $timeline_random . '" data-target="ts-timeline-css-content-' . $timeline_random . '">';
             echo '<option value="asc" ' . ($timeline_order == 'asc' ? 'selected="selected"' : '') . '>' . $timeline_sort_asc . '</option>';
             echo '<option value="desc" ' . ($timeline_order == 'desc' ? 'selected="selected"' : '') . '>' . $timeline_sort_desc . '</option>';
             echo '</select>';
             echo '</div>';
         }
         // Timeline Title
         if (!empty($timeline_title_text)) {
             echo '<div class="ts-timeline-css-title-wrapper">';
             echo '<div class="ts-timeline-css-title-string" style="color: ' . $timeline_title_color . ';">' . $timeline_title_text . '</div><div class="ts-timeline-css-title-after"></div>';
             echo '</div>';
         }
         echo '<div class="ts-timeline-css-wrapper ' . $timeline_layout . '">';
         echo '<div id="ts-timeline-css-spine-' . $timeline_random . '" class="ts-timeline-css-spine ts-timeline-css-animated"></div>';
         echo '<div id="ts-timeline-css-content-' . $timeline_random . '" class="ts-timeline-css-content ' . ($show_categories == "true" ? "ts-timeline-css-content-show-cats" : "ts-timeline-css-content-hide-cats") . ' ' . ($show_tags == "true" ? "ts-timeline-css-content-show-tags" : "ts-timeline-css-content-hide-tags") . '">';
         // Create Individual Post Output
         $postBreak = '';
         $postCounter = 0;
         $breakCounter = 0;
         $postMonths = array();
         if (post_type_exists($post_type) && $timelineposts->have_posts()) {
             while ($timelineposts->have_posts()) {
                 $timelineposts->the_post();
                 $matched_terms = 0;
                 if ($matched_terms == 0) {
                     $postCounter++;
                     $postTitle = '';
                     $postBreak = '';
                     $postLink = '';
                     $postData = '';
                     $postMedia = '';
                     $postCategories = '';
                     $postTags = '';
                     if ($postCounter < $posts_limit + 1) {
                         $postTitle = get_the_title();
                         $postDate = get_post_time('U');
                         $postLink = get_permalink();
                         if ($show_periods == 'true') {
                             $postPeriod = get_post_time('F Y');
                             if (!in_array($postPeriod, $postMonths)) {
                                 array_push($postMonths, $postPeriod);
                                 $breakCounter++;
                                 $breakMonth = get_post_time('n');
                                 $breakYear = get_post_time('Y');
                                 $breakStart = mktime(0, 0, 1, $breakMonth, 1, $breakYear);
                                 $breakEnd = mktime(23, 59, 59, $breakMonth, cal_days_in_month(CAL_GREGORIAN, $breakMonth, $breakYear), $breakYear);
                                 $postBreak .= '<div id="ts-vcsc-timeline-section-break-' . $timeline_random . '-' . $breakCounter . '" class="ts-timeline-css-section ts-timeline-css-break ts-timeline-css-visible" style="width: 50%; ' . $vc_inline_style . '" data-full="Break: ' . $postPeriod . '" data-date="' . ($timeline_sort == "asc" ? $breakStart : $breakEnd) . '" data-start="' . $breakStart . '" data-end="' . $breakEnd . '" data-fullwidth="false" data-categories="' . $timeline_filter_breaks . '" data-tags="" data-filtered-categories="false" data-filtered-tags="false">';
                                 $postBreak .= '<div class="ts-timeline-css-text-wrap" style="">';
                                 $postBreak .= '<div class="ts-timeline-css-text-wrap-inner" style="width: 100%; left: 0; margin: 0 !important; padding: 0;">';
                                 $postBreak .= '<h3 class="ts-timeline-css-title" style="padding: 0 10px; text-align: center; color: ' . $timeline_title_color . '; margin: 0 !important; padding: 0;">' . $postPeriod . '</h3>';
                                 $postBreak .= '<div class="ts-timeline-css-text"></div>';
                                 $postBreak .= '</div>';
                                 $postBreak .= '<div class="clearFixMe"></div>';
                                 $postBreak .= '</div>';
                                 $postBreak .= '</div>';
                                 echo $postBreak;
                             }
                         }
                         $postAttributes = 'data-visible="false" data-full="' . get_post_time($date_format) . '" data-author="' . get_the_author() . '" data-date="' . $postDate . '" data-start="' . $postDate . '" data-end="' . $postDate . '" data-modified="' . get_the_modified_time('U') . '" data-title="' . get_the_title() . '" data-comments="' . get_comments_number() . '" data-id="' . get_the_ID() . '"';
                         // Get Post Categories
                         if (taxonomy_exists($menu_tax)) {
                             foreach (get_the_terms($timelineposts->post->ID, $menu_tax) as $term) {
                                 $postCategories .= $term->name . ',';
                             }
                             $postCategories = substr($postCategories, 0, -1);
                         }
                         // Get Post Tags
                         foreach (wp_get_post_tags($timelineposts->post->ID) as $term) {
                             $postTags .= $term->name . ',';
                         }
                         $postTags = substr($postTags, 0, -1);
                         // Build Post Output
                         echo '<div id="ts-vcsc-timeline-section-post-' . $timeline_random . '-' . $postCounter . '" class="ts-timeline-css-section ts-timeline-css-event ts-timeline-css-visible ts-timeline-css-animated ' . ($show_date ? "ts-timeline-css-date-true" : "ts-timeline-css-date-false") . '" style="' . $vc_inline_style . '" data-categories="' . $postCategories . '" data-tags="' . $postTags . '" data-filtered-categories="false" data-filtered-tags="false" ' . $postAttributes . '>';
                         echo '<div class="ts-timeline-css-text-wrap ' . ($show_date ? "ts-timeline-css-text-wrap-date" : "ts-timeline-css-text-wrap-nodate") . '" style="' . ($show_date ? "padding-top: 35px" : "") . '">';
                         if ($show_date == "true") {
                             echo '<div class="ts-timeline-css-date"><span class="ts-timeline-css-date-connect"><span class="ts-timeline-css-date-text"><i class="ts-timeline-css-date-icon dashicons dashicons-calendar"></i>' . get_post_time($date_format, false, null, $datetime_translate == "true" ? true : false) . '</span></span></div>';
                         }
                         if ($show_featured == "true") {
                             $postMedia = '';
                             if (strlen(get_the_post_thumbnail()) > 0 && strlen(get_post_thumbnail_id()) > 0) {
                                 $media_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                 if ($media_image != false) {
                                     $image_extension = pathinfo($media_image[0], PATHINFO_EXTENSION);
                                     $alt_attribute = basename($media_image[0], "." . $image_extension);
                                     if ($featured_link == "none") {
                                         $postMedia .= '<div class="ts-timeline-media" style="max-width: ' . $media_image[1] . 'px; width: 100%; height: auto; margin: 0 auto; float: none;">';
                                         $postMedia .= '<img class="" src="' . $media_image[0] . '" alt="' . $alt_attribute . '" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; width: 100%; height: auto;">';
                                         $postMedia .= '</div>';
                                     } else {
                                         if ($featured_link == "current" || $featured_link == "newone") {
                                             $postMedia .= '<a class="ts-timeline-media" href="' . get_permalink() . '" target="' . ($featured_link == "current" ? '_parent' : '_blank') . '" style="text-decoration: none; border: none; margin: 0; padding: 0;">';
                                             $postMedia .= '<div class="ts-timeline-media" style="max-width: ' . $media_image[1] . 'px; width: 100%; height: auto; margin: 0 auto; float: none;">';
                                             $postMedia .= '<img class="" src="' . $media_image[0] . '" alt="' . $alt_attribute . '" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; width: 100%; height: auto;">';
                                             $postMedia .= '</div>';
                                             $postMedia .= '</a>';
                                         } else {
                                             if ($featured_link == "lightbox") {
                                                 $postMedia .= '<div class="ts-timeline-media nchgrid-item nchgrid-tile nch-lightbox-image" style="max-width: ' . $media_image[1] . 'px; width: 100%; height: auto; margin: 0 auto; float: none;">';
                                                 $postMedia .= '<a href="' . $media_image[0] . '" class="nch-lightbox-media no-ajaxy" data-thumbnail="' . $media_image[0] . '" data-title="' . $postTitle . '" rel="timelinegroup" data-share="0" data-effect="' . $lightbox_effect . '" data-social="0" data-duration="' . $lightbox_speed . '" ' . $nacho_color . '>';
                                                 $postMedia .= '<img src="' . $media_image[0] . '" alt="' . $alt_attribute . '" title="" style="max-width: ' . $media_image[1] . 'px; padding: 0; margin: 0 auto; display: block; width: 100%; height: auto;">';
                                                 $postMedia .= '<div class="nchgrid-caption"></div>';
                                                 $postMedia .= '<div class="nchgrid-caption-text">' . $postTitle . '</div>';
                                                 $postMedia .= '</a>';
                                                 $postMedia .= '</div>';
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         echo $postMedia;
                         echo '<h3 class="ts-timeline-css-title" style="text-align: center; border: none; margin-bottom: 0; padding-bottom: 0;">' . $postTitle . '</h3>';
                         echo '<div style="width: 100%; display: block; float: left; position: relative; padding-bottom: 15px;">';
                         echo '<div class="ts-timeline-css-text-wrap-inner" style="width: 100%; height: 100%; left: 0;">';
                         echo '<div class="ts-timeline-css-text" style="">';
                         if ($content_show == "excerpt") {
                             echo get_the_excerpt();
                         } else {
                             if ($content_show == "cutcharacters") {
                                 $content = apply_filters('the_content', get_the_content());
                                 $excerpt = TS_VCSC_TruncateHTML($content, $content_cutoff, '...', false, true);
                                 echo $excerpt;
                             } else {
                                 if ($content_show == "complete") {
                                     $content = apply_filters('the_content', get_the_content());
                                     echo do_shortcode($content);
                                 }
                             }
                         }
                         echo '</div>';
                         echo '</div>';
                         echo '</div>';
                         // Post Link Button
                         if ($button_show == "true") {
                             echo '<div class="ts-timeline-css-button-container">';
                             echo '<div class="ts-timeline-css-button-outer clearFixMe" style="width: ' . $button_width . '%; margin-left: auto; margin-right: auto;">';
                             echo '<div class="ts-timeline-css-button-wrapper">';
                             echo '<a class="ts-timeline-css-button-link ' . $button_style . ' ' . $button_hover . '" href="' . $postLink . '" target="' . $button_target . '" title="' . $button_text . '">' . $button_text . '</a>';
                             echo '</div>';
                             echo '</div>';
                             echo '</div>';
                         }
                         // Post Social Share
                         if ($show_share == 'true') {
                             echo '<div class="ts-timeline-css-social">';
                             echo '<a href="http://pinterest.com/pin/create/link/?url=' . $postLink . '&amp;description=' . $postTitle . '" class="ts-timeline-css-social-holder" rel="external" target="_blank"><span class="ts-timeline-css-social-pinterest"></span></a>';
                             echo '<a href="https://plusone.google.com/_/+1/confirm?hl=en&amp;url=' . $postLink . '&amp;name=' . $postTitle . '" class="ts-timeline-css-social-holder" rel="external" target="_blank"><span class="ts-timeline-css-social-google"></span></a>';
                             echo '<a href="http://twitter.com/share?text=' . $postTitle . '&url=' . $postLink . '" class="ts-timeline-css-social-holder" rel="external" target="_blank"><span class="ts-timeline-css-social-twitter"></span></a>';
                             echo '<a href="http://www.facebook.com/sharer.php?u=' . $postLink . '" class="ts-timeline-css-social-holder" rel="external" target="_blank"><span class="ts-timeline-css-social-facebook"></span></a>';
                             echo '</div>';
                         }
                         // Post Tags
                         if ($postTags != '' && $show_tags == "true") {
                             echo '<div class="ts-timeline-css-output-tags"><i class="dashicons dashicons-tag"></i><span>' . str_replace(",", ", ", $postTags) . '</span></div>';
                         }
                         // Post Categories
                         if ($postCategories != '' && $show_categories == "true") {
                             echo '<div class="ts-timeline-css-output-cats"><i class="dashicons dashicons-category"></i><span>' . str_replace(",", ", ", $postCategories) . '</span></div>';
                         }
                         // Post Time / Author / Type / Comments
                         if ($show_metadata == 'true') {
                             echo '<div class="ts-timeline-css-metadata clearFixMe" style="' . ($show_editlinks == 'true' && is_admin_bar_showing() ? 'margin-bottom: 0px;' : '') . '">';
                             if ($show_avatar == 'true') {
                                 echo get_avatar(get_the_author_meta('ID'), $size = '40');
                             }
                             echo '<div class="ts-timeline-css-author">';
                             echo get_the_author();
                             echo '</div>';
                             $format = get_post_format();
                             if (false === $format) {
                                 $format = __('Standard', "ts_visual_composer_extend");
                                 $class = 'standard';
                             } else {
                                 $class = strtolower($format);
                             }
                             echo '<div class="ts-timeline-css-type ts-timeline-css-type-' . $class . '">';
                             echo ucfirst($format);
                             echo '</div>';
                             echo '<div class="ts-timeline-css-time">';
                             echo get_post_time($time_format, false, null, $datetime_translate == "true" ? true : false);
                             echo '</div>';
                             echo '<div class="ts-timeline-css-comments">';
                             echo get_comments_number();
                             echo '</div>';
                             echo '</div>';
                         }
                         // Edit Links
                         if ($show_editlinks == 'true' && is_admin_bar_showing()) {
                             echo '<div class="ts-timeline-css-editlinks clearFixMe">';
                             echo '<span class="ts-timeline-css-edit"></span>';
                             echo '<span class="ts-timeline-css-links">';
                             echo edit_post_link();
                             echo '</span>';
                             echo '</div>';
                         }
                         echo '<div class="clearFixMe"></div>';
                         echo '</div>';
                         echo '</div>';
                     }
                 }
             }
             wp_reset_postdata();
         } else {
             echo '<p>Nothing found. Please check back soon!</p>';
         }
         echo '</div>';
         echo '</div>';
         // Lazyload Trigger
         if ($timeline_lazy == "true") {
             echo '<div class="ts-timeline-css-showmore-wrap">';
             echo '<span class="ts-timeline-css-showmore ts-dual-buttons-color-peter-river-flat ts-dual-buttons-color-belize-hole-flat">' . $timeline_load . '</span>';
             echo '</div>';
         }
         echo '</div>';
     }
     $myvariable = ob_get_clean();
     return $myvariable;
 }