Example #1
0
 protected function content($atts, $content = null)
 {
     $html_id = tbHtmlID('tb-masonry');
     $source = $atts['source'];
     list($args, $wp_query) = vc_build_loop_query($source);
     $atts['cat'] = isset($args['cat']) ? $args['cat'] : '';
     /* get posts */
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     if ($paged > 1) {
         $args['paged'] = $paged;
         $wp_query = new WP_Query($args);
     }
     $atts['posts'] = $wp_query;
     $grid = shortcode_atts(array('col_lg' => 4, 'col_md' => 3, 'col_sm' => 2, 'col_xs' => 1, 'layout' => 'basic', 'margin' => 0, 'ratio' => 0.5), $atts);
     $atts['item_class'] = "tb-masonry-item";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $class;
     $atts['post_id'] = get_the_ID();
     $atts['html_id'] = $html_id;
     //Masonry Settings
     global $tb_masonry;
     $tb_masonry[$html_id] = array('post_id' => get_the_ID(), 'grid_margin' => (int) $atts['margin'], 'grid_ratio' => (double) $atts['ratio'], 'grid_cols_xs' => (int) $grid['col_xs'], 'grid_cols_sm' => (int) $grid['col_sm'], 'grid_cols_md' => (int) $grid['col_md'], 'grid_cols_lg' => (int) $grid['col_lg']);
     wp_localize_script('tb-masonry', "tbMasonry", $tb_masonry);
     wp_enqueue_script('tb-masonry');
     if (current_user_can('manage_options')) {
         wp_enqueue_script('jquery-ui-resizable');
         wp_enqueue_style('tb-jquery-ui');
         wp_enqueue_script('tb-masonry-admin');
     }
     return parent::content($atts, $content);
 }
Example #2
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('mode' => 'horitbntal', 'item_title' => '', 'show_value' => 'false', 'value' => '60', 'value_suffix' => '', 'bg_color' => '#e9e9e9', 'color' => '', 'width' => '250px', 'height' => '50px', 'border_radius' => '', 'striped' => 'no', 'class' => ''), $atts);
     $atts['icon_type'] = isset($atts['icon_type']) ? $atts['icon_type'] : 'fontawesome';
     $atts = array_merge($atts_extra, $atts);
     if ($atts['icon_type'] == 'pe7stroke') {
         wp_enqueue_style('tb-icon-pe7stroke', TB_CSS . 'Pe-icon-7-stroke.css');
     } else {
         vc_icon_element_fonts_enqueue($atts['icon_type']);
     }
     /* CSS */
     wp_register_style('bootstrap-progressbar', TB_CSS . "bootstrap-progressbar.min.css", "", "0.7.0", "all");
     wp_enqueue_style('bootstrap-progressbar');
     /* JS */
     wp_register_script('bootstrap-progressbar', TB_JS . "bootstrap-progressbar.min.js", array('jquery'), "0.7.0", true);
     wp_register_script('tb-progressbar', TB_JS . "bootstrap-progressbar.tb.js", array('jquery', 'bootstrap-progressbar'), "1.0.0", true);
     wp_enqueue_script('tb-progressbar');
     wp_enqueue_script('waypoints');
     /* Layout */
     $html_id = tbHtmlID('tb-progressbar');
     /* Get Icon */
     $icon_name = "icon_" . $atts['icon_type'];
     $atts['icon'] = isset($atts[$icon_name]) ? $atts[$icon_name] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Example #3
0
 protected function content($atts, $content = null)
 {
     wp_enqueue_script('tb-grid-pagination', TB_JS . 'tbgrid.pagination.js', array('jquery'), '1.0.0', true);
     $html_id = tbHtmlID('tb-grid');
     $source = $atts['source'];
     list($args, $wp_query) = vc_build_loop_query($source);
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     if ($paged > 1) {
         $args['paged'] = $paged;
         $wp_query = new WP_Query($args);
     }
     $atts['cat'] = isset($args['cat']) ? $args['cat'] : '';
     /* get posts */
     $atts['posts'] = $wp_query;
     $grid = shortcode_atts(array('col_lg' => 4, 'col_md' => 3, 'col_sm' => 2, 'col_xs' => 1, 'layout' => 'basic'), $atts);
     $col_lg = 12 / $grid['col_lg'];
     $col_md = 12 / $grid['col_md'];
     $col_sm = 12 / $grid['col_sm'];
     $col_xs = 12 / $grid['col_xs'];
     $atts['item_class'] = "tb-grid-item col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-xs-{$col_xs}";
     $atts['grid_class'] = "tb-grid";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $class;
     if ($grid['layout'] == 'masonry') {
         wp_enqueue_script('tb-jquery-shuffle');
         $atts['grid_class'] .= " tb-grid-{$grid['layout']}";
     }
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Example #4
0
 protected function content($atts, $content = null)
 {
     //default value
     $atts_extra = shortcode_atts(array('xsmall_items' => 1, 'small_items' => 2, 'medium_items' => 3, 'large_items' => 4, 'margin' => 0, 'loop' => 1, 'mousedrag' => 1, 'touchdrag' => 1, 'nav' => 1, 'dots' => 1, 'center' => 0, 'autoplay' => 1, 'autoplaytimeout' => '5000', 'smartspeed' => '250', 'autoplayhoverpause' => 1, 'left_arrow' => 'fa fa-arrow-left', 'right_arrow' => 'fa fa-arrow-right', 'filter' => "false", 'class' => ''), $atts);
     global $tb_carousel;
     $atts = array_merge($atts_extra, $atts);
     wp_enqueue_style('owl-carousel', TB_CSS . 'owl.carousel.css', '', '2.0.0b', 'all');
     wp_enqueue_script('owl-carousel', TB_JS . 'owl.carousel.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-autoplay', TB_JS . 'owl.autoplay.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-navigation', TB_JS . 'owl.navigation.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-animate', TB_JS . 'owl.animate.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-carousel-tb', TB_JS . 'owl.carousel.tb.js', array('jquery'), '1.0.0', true);
     $source = $atts['source'];
     list($args, $posts) = vc_build_loop_query($source);
     $atts['posts'] = $posts;
     $html_id = tbHtmlID('tb-carousel');
     $atts['autoplaytimeout'] = isset($atts['autoplaytimeout']) ? (int) $atts['autoplaytimeout'] : 5000;
     $atts['smartspeed'] = isset($atts['smartspeed']) ? (int) $atts['smartspeed'] : 250;
     $left_arrow = isset($atts['left_arrow']) ? $atts['left_arrow'] : 'fa fa-arrow-left';
     $right_arrow = isset($atts['right_arrow']) ? $atts['right_arrow'] : 'fa fa-arrow-right';
     $tb_carousel[$html_id] = array('margin' => (int) $atts['margin'], 'autoHeight' => false, 'loop' => $atts['loop'] == 1 ? true : false, 'mouseDrag' => $atts['mousedrag'] == 1 ? true : false, 'touchDrag' => $atts['touchdrag'] == 1 ? true : false, 'nav' => $atts['nav'] == 1 ? true : false, 'dots' => $atts['dots'] == 1 ? true : false, 'center' => $atts['center'] == 1 ? true : false, 'autoplay' => $atts['autoplay'] == 1 ? true : false, 'autoplayTimeout' => $atts['autoplaytimeout'], 'smartSpeed' => $atts['smartspeed'], 'autoplayHoverPause' => $atts['autoplayhoverpause'] == 1 ? true : false, 'navText' => array('<i class="' . $left_arrow . '"></i>', '<i class="' . $right_arrow . '"></i>'), 'dotscontainer' => $html_id . ' .tb-dots', 'items' => (int) $atts['large_items'], 'responsive' => array(0 => array("items" => (int) $atts['xsmall_items']), 768 => array("items" => (int) $atts['small_items']), 992 => array("items" => (int) $atts['medium_items']), 1200 => array("items" => (int) $atts['large_items'])));
     wp_localize_script('owl-carousel-tb', "tbcarousel", $tb_carousel);
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Example #5
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('item_id' => '', 'title' => '', 'description' => '', 'content_align' => 'default', 'tb_cols' => '1 Column', 'button_type' => 'button', 'button_text' => '', 'class' => ''), $atts);
     $atts = array_merge($atts_extra, $atts);
     $html_id = tbHtmlID('tb-fancy-box');
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' content-align-' . $atts['content_align'] . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Example #6
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('title' => '', 'description' => '', 'grouping' => 'false', 'separator' => ',', 'content_align' => 'default', 'tb_cols' => '1 Column', 'class' => ''), $atts);
     $atts = array_merge($atts_extra, $atts);
     wp_register_script('counter', TB_JS . 'counter.min.js', array('jquery'), '1.0.0', true);
     wp_register_script('counter-tb', TB_JS . 'counter.tb.js', array('counter', 'waypoints'), '1.0.0', true);
     wp_enqueue_script('counter-tb');
     $html_id = tbHtmlID('tb-counter');
     $class = $atts['class'] ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' content-align-' . $atts['content_align'] . ' ' . $class;
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('title' => '', 'description' => '', 'content_align' => 'default', 'button_type' => 'button', 'button_text' => '', 'button_link' => '', 'icon_type' => 'fontawesome', 'icon_fontawesome' => '', 'icon_openiconic' => '', 'icon_typicons' => '', 'icon_entypoicons' => '', 'icon_linecons' => '', 'icon_entypo' => '', 'icon_pe7stroke' => '', 'description_item' => '', 'class' => ''), $atts);
     $atts = array_merge($atts_extra, $atts);
     $atts['icon_type'] = isset($atts['icon_type']) ? $atts['icon_type'] : 'fontawesome';
     $atts['description_item'] = isset($atts['description_item']) ? $atts['description_item'] : '';
     $atts['title_item'] = isset($atts['title_item']) ? $atts['title_item'] : '';
     if ($atts['icon_type'] == 'pe7stroke') {
         wp_enqueue_style('tb-icon-pe7stroke', TB_CSS . 'Pe-icon-7-stroke.css');
     } else {
         vc_icon_element_fonts_enqueue($atts['icon_type']);
     }
     $html_id = tbHtmlID('tb-fancy-box-single');
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' content-align-' . $atts['content_align'] . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }