Пример #1
0
 protected function content($atts, $content = null)
 {
     $html_id = zoHtmlID('zo-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'] = "zo-masonry-item";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' ' . $class;
     $atts['post_id'] = get_the_ID();
     $atts['html_id'] = $html_id;
     //Masonry Settings
     global $zo_masonry;
     $zo_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('zo-masonry', "zoMasonry", $zo_masonry);
     wp_enqueue_script('zo-masonry');
     if (current_user_can('manage_options')) {
         wp_enqueue_script('jquery-ui-resizable');
         wp_enqueue_style('zo-jquery-ui');
         wp_enqueue_script('zo-masonry-admin');
     }
     return parent::content($atts, $content);
 }
Пример #2
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 $zo_carousel;
     $atts = array_merge($atts_extra, $atts);
     wp_enqueue_style('owl-carousel', ZO_CSS . 'owl.carousel.css', '', '2.0.0b', 'all');
     wp_enqueue_script('owl-carousel', ZO_JS . 'owl.carousel.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-autoplay', ZO_JS . 'owl.autoplay.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-navigation', ZO_JS . 'owl.navigation.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-animate', ZO_JS . 'owl.animate.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-carousel-zo', ZO_JS . 'owl.carousel.zo.js', array('jquery'), '1.0.0', true);
     $source = $atts['source'];
     list($args, $posts) = vc_build_loop_query($source);
     $atts['posts'] = $posts;
     $html_id = zoHtmlID('zo-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';
     $zo_carousel[$html_id] = array('margin' => (int) $atts['margin'], '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 . ' .zo-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-zo', "zocarousel", $zo_carousel);
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Пример #3
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('mode' => 'horizontal', '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('zo-icon-pe7stroke', ZO_CSS . 'Pe-icon-7-stroke.css');
     } else {
         vc_icon_element_fonts_enqueue($atts['icon_type']);
     }
     /* CSS */
     wp_register_style('bootstrap-progressbar', ZO_CSS . "bootstrap-progressbar.min.css", "", "0.7.0", "all");
     wp_enqueue_style('bootstrap-progressbar');
     /* JS */
     wp_register_script('bootstrap-progressbar', ZO_JS . "bootstrap-progressbar.min.js", array('jquery'), "0.7.0", true);
     wp_register_script('zo-progressbar', ZO_JS . "bootstrap-progressbar.zo.js", array('jquery', 'bootstrap-progressbar'), "1.0.0", true);
     wp_enqueue_script('zo-progressbar');
     wp_enqueue_script('waypoints');
     /* Layout */
     $html_id = zoHtmlID('zo-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['zo_template']) . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Пример #4
0
 protected function content($atts, $content = null)
 {
     wp_enqueue_script('zo-grid-pagination', ZO_JS . 'zogrid.pagination.js', array('jquery'), '1.0.0', true);
     $html_id = zoHtmlID('zo-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'] = "zo-grid-item col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-xs-{$col_xs}";
     $atts['grid_class'] = "zo-grid";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' ' . $class;
     if ($grid['layout'] == 'masonry') {
         wp_enqueue_script('zo-jquery-shuffle');
         $atts['grid_class'] .= " zo-grid-{$grid['layout']}";
     }
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Пример #5
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('title' => '', 'description' => '', 'content_align' => 'default', 'zo_cols' => '1 Column', 'button_type' => 'button', 'button_text' => '', 'class' => ''), $atts);
     $atts = array_merge($atts_extra, $atts);
     $html_id = zoHtmlID('zo-fancy-box');
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' content-align-' . $atts['content_align'] . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Пример #6
0
 protected function content($atts, $content = null)
 {
     $atts_extra = shortcode_atts(array('title' => '', 'description' => '', 'content_align' => 'default', 'zo_cols' => '1 Column', 'class' => ''), $atts);
     $atts = array_merge($atts_extra, $atts);
     wp_register_script('counter', ZO_JS . 'counter.min.js', array('jquery'), '1.0.0', true);
     wp_register_script('counter-zo', ZO_JS . 'counter.zo.js', array('counter', 'waypoints'), '1.0.0', true);
     wp_enqueue_script('counter-zo');
     $html_id = zoHtmlID('zo-counter');
     $class = $atts['class'] ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' content-align-' . $atts['content_align'] . ' ' . $class;
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
Пример #7
0
 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('zo-icon-pe7stroke', ZO_CSS . 'Pe-icon-7-stroke.css');
     } else {
         vc_icon_element_fonts_enqueue($atts['icon_type']);
     }
     $html_id = zoHtmlID('zo-fancy-box-single');
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' content-align-' . $atts['content_align'] . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }