function gmap($atts, $content = null) { $atts = vc_map_get_attributes('gmap', $atts); extract($atts); if ($latitude == '') { $latitude = '-7.796873'; } if ($longitude == '') { $longitude = '110.369180'; } if ($size == '') { $size = 200; } if ($zoom == '') { $zoom = 14; } $out = ''; wp_enqueue_script('gmap3'); wp_enqueue_script('googleapis'); $size = str_replace(array('px', ' '), array('', ''), $size); $out .= '<div class="gmaps_widget wpb_content_element">'; $out .= '<div class="wpb_wrapper">'; $out .= wpb_widget_title(array('title' => $title)); $out .= '<div id="map" data-latitude="' . $latitude . '" data-longitude="' . $longitude . '" data-zoom="' . $zoom . '" data-height="' . $size . '"></div>'; $out .= '</div>'; $out .= '</div>'; return $out; }
function shortcode_handler($atts, $content = null) { if (function_exists('wpb_map')) { // extract($this->getPreparedAtts($atts, $content)); // // $src = $src ? wp_get_attachment_image_src($src, $image_size) : ''; // $src = is_array($src) ? $src[0] : ''; // // return sprintf('<img src="%s" class="img-%s">', $src, $style); $output = $el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $css_animation = ''; extract(shortcode_atts(array('title' => '', 'image' => $image, 'img_size' => 'full', 'img_link_large' => false, 'img_link' => '', 'img_link_target' => '_self', 'el_class' => '', 'css_animation' => '', 'style' => '', 'align' => 'none'), $atts)); $img_id = preg_replace('/[^\\d]/', '', $image); $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size)); if ($img == NULL) { $img['thumbnail'] = '<img src="http://placekitten.com/g/400/300" /> <small>' . __('This is image placeholder, edit your page to replace it.', 'adap_sc') . '</small>'; } $el_class = $this->getExtraClass($el_class); $a_class = ''; if ($img_link_target == 'lightbox') { wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $a_class = ' class="prettyphoto"'; } elseif ($el_class != '') { $tmp_class = explode(" ", strtolower($el_class)); $tmp_class = str_replace(".", "", $tmp_class); if (in_array("prettyphoto", $tmp_class)) { wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $a_class = ' class="prettyphoto"'; $el_class = str_ireplace(" prettyphoto", "", $el_class); } } $link_to = ''; if ($img_link_large == true) { $link_to = wp_get_attachment_image_src($img_id, 'large'); $link_to = $link_to[0]; } else { if (!empty($img_link)) { $link_to = $img_link; } } $img['thumbnail'] = str_replace('class="', 'class="' . $style . ' ', $img['thumbnail']); $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . ($img_link_target != '_self' ? ' target="' . $img_link_target . '"' : '') . '>' . $img['thumbnail'] . '</a>' : $img['thumbnail']; $css_class = $this->getCSSAnimation($css_animation); $css_class .= ' pull-' . $align; $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= "\n\t\t\t" . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading')); $output .= "\n\t\t\t" . $image_string; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_single_image'); return $output; } else { return ''; } }
function content_block_vc_func($atts, $content = null) { extract(shortcode_atts(array('title' => '', 'id' => '', 'el_class' => ''), $atts)); $content = wpb_js_remove_wpautop($content); // fix unclosed/unwanted paragraph tags in $content $output = ''; $width = ''; $output .= "\n\t" . '<div class="wpb_content_block wpb_content_element' . $width . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_content_block_heading')); $output .= do_shortcode("[content_block id='{$id}']"); $output .= "\n\t\t" . '</div> '; $output .= "\n\t" . '</div> '; return $output; }
protected function contentInline($atts, $content = null) { $output = ''; extract(shortcode_atts(array('el_class' => '', 'title' => '', 'flickr_id' => '95572727@N00', 'count' => '6', 'type' => 'user', 'display' => 'latest'), $atts)); $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_flickr_widget wpb_content_element' . $el_class, $this->settings['base']); $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_flickr_heading')); $output .= "\n\t\t\t" . '<div class="vc-flickr-inline-placeholder" data-link="http://www.flickr.com/badge_code_v2.gne?count=' . $count . '&display=' . $display . '&size=s&layout=x&source=' . $type . '&' . $type . '=' . $flickr_id . '"></div>'; $output .= "\n\t\t\t" . '<p class="flickr_stream_wrap"><a class="wpb_follow_btn wpb_flickr_stream" href="http://www.flickr.com/photos/' . $flickr_id . '">' . __("View stream on flickr", "js_composer") . '</a></p>'; $output .= "\n\t\t" . '</div>' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div>' . $this->endBlockComment('.wpb_flickr_widget') . "\n"; return $output; }
protected function content($atts, $content = null) { $title = $link = $size = $zoom = $type = $el_position = $width = $el_class = ''; extract(shortcode_atts(array('title' => '', 'link' => 'https://maps.google.com/maps?q=New+York&hl=en&sll=40.686236,-73.995409&sspn=0.038009,0.078192', 'size' => 200, 'zoom' => 14, 'type' => 'm', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); $output = ''; if ($link == '') { return null; } $el_class = $this->getExtraClass($el_class); $width = ''; //wpb_translateColumnWidthToSpan($width); $size = str_replace(array('px', ' '), array('', ''), $size); $output .= "\n\t" . '<div class="wpb_gmaps_widget wpb_content_element' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; //$output .= ($title != '' ) ? "\n\t\t\t".'<h2 class="wpb_heading wpb_map_heading">'.$title.'</h2>' : ''; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_map_heading')); $output .= '<div class="wpb_map_wraper"><iframe width="100%" height="' . $size . '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' . $link . '&t=' . $type . '&z=' . $zoom . '&output=embed"></iframe></div>'; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); return $output; }
<?php if (isset($atts['el_class'])) { $el_class = ' ' . $atts['el_class']; unset($atts['el_class']); } else { $el_class = ''; } if (isset($atts['title'])) { $title = $atts['title']; unset($atts['title']); } else { $title = ''; } $classes = array(apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_om-portfolio wpb_content_element' . $el_class, 'om_portfolio', $atts)); $atts_str = ''; foreach ($atts as $k => $v) { $atts_str .= ' ' . $k . '="' . $v . '"'; } echo '<div class="' . implode(' ', $classes) . '">'; echo wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_om_portfolio_heading')); echo do_shortcode('[portfolio' . $atts_str . ']'); echo '</div>';
if (!empty($a_attrs['class'])) { $wrapperClass .= ' ' . $a_attrs['class']; unset($a_attrs['class']); } $html = '<a ' . vc_stringify_attributes($a_attrs) . ' class="' . $wrapperClass . '">' . $img['thumbnail'] . '</a>'; } else { $html = '<div class="' . $wrapperClass . '">' . $img['thumbnail'] . '</div>'; } $class_to_filter = 'wpb_single_image wpb_content_element vc_align_' . $alignment . ' ' . $this->getCSSAnimation($css_animation); $class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts); if (in_array($source, array('media_library', 'featured_image')) && 'yes' === $add_caption) { $post = get_post($img_id); $caption = $post->post_excerpt; } else { if ('external_link' === $source) { $add_caption = 'yes'; } } if ('yes' === $add_caption && '' !== $caption) { $html .= '<figcaption class="vc_figure-caption">' . esc_html($caption) . '</figcaption>'; } $output = ' <div class="' . esc_attr(trim($css_class)) . '"> ' . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading')) . ' <figure class="wpb_wrapper vc_figure"> ' . $html . ' </figure> </div> '; echo $output;
$link = trim(vc_value_from_safe($link)); $bubble = $bubble !== '' && $bubble !== '0' ? '&iwloc=near' : ''; $size = str_replace(array('px', ' '), array('', ''), $size); if (is_numeric($size)) { $link = preg_replace('/height="[0-9]*"/', 'height="' . $size . '"', $link); } $class_to_filter = 'wpb_gmaps_widget wpb_content_element' . ($size === '' ? ' vc_map_responsive' : ''); $class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts); ?> <div class="<?php echo esc_attr($css_class); ?> "> <?php echo wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_map_heading')); ?> <div class="wpb_wrapper"> <div class="wpb_map_wraper"> <?php if (preg_match('/^\\<iframe/', $link)) { echo $link; } else { // TODO: refactor or remove outdated/deprecated attributes that is not mapped in gmaps. echo '<iframe width="100%" height="' . $size . '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' . $link . '&t=' . $type . '&z=' . $zoom . '&output=embed' . $bubble . '"></iframe>'; } ?> </div> </div> </div>
$iconFile = apply_filters('4k_icon_font_pack_path', $iconFile, $cssFile); // Fix ligature icons (these are icons that use more than 1 symbol e.g. mono social icons) $ligatureStyle = ''; if ($cssFile == 'mn') { $ligatureStyle = '-webkit-font-feature-settings:"liga","dlig";-moz-font-feature-settings:"liga=1, dlig=1";-moz-font-feature-settings:"liga","dlig";-ms-font-feature-settings:"liga","dlig";-o-font-feature-settings:"liga","dlig"; font-feature-settings:"liga","dlig"; text-rendering:optimizeLegibility;'; } $iconCode = ''; if (!empty($tab_atts['icon'])) { $iconCode = $iconContents[$tab_atts['icon']]; } $ret = "<style>\n @font-face {\n \tfont-family: '" . $cssFile . "';\n \tsrc:url('" . $iconFile . ".eot');\n \tsrc:url('" . $iconFile . ".eot?#iefix') format('embedded-opentype'),\n \t\turl('" . $iconFile . ".woff') format('woff'),\n \t\turl('" . $iconFile . ".ttf') format('truetype'),\n \t\turl('" . $iconFile . ".svg#oi') format('svg');\n \tfont-weight: normal;\n \tfont-style: normal;\n }\n #rand_" . $tab_id . " ." . $tab_atts['icon'] . ":before { font-family: '" . $cssFile . "'; font-weight: normal; font-style: normal; }\n #rand_" . $tab_id . " ." . $tab_atts['icon'] . ":before { content: \"" . $iconCode . "\"; {$ligatureStyle} }\n"; $ret .= "</style>"; // Compress styles a bit for readability $ret = preg_replace("/\\s?(\\{|\\})\\s?/", "\$1", preg_replace("/\\s+/", " ", str_replace("\n", "", $ret))) . "\n"; $tabs_nav .= $ret; $tabs_nav .= '<li class="tabli" id="rand_' . $tab_id . '"><a href="#tab-' . (isset($tab_atts['tab_id']) ? $tab_atts['tab_id'] : sanitize_title($tab_atts['title'])) . '"><i class="' . $tab_atts['icon'] . '"></i>' . $tab_atts['title'] . '</a></li>'; } else { $tabs_nav .= '<li class="tabli"><a href="#tab-' . (isset($tab_atts['tab_id']) ? $tab_atts['tab_id'] : sanitize_title($tab_atts['title'])) . '">' . $tab_atts['title'] . '</a></li>'; } } } $tabs_nav .= '</ul>' . "\n"; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim($element . ' wpb_content_element ' . $el_class), $this->settings['base'], $atts); $output .= wpb_widget_title(array('title' => $title, 'extraclass' => $element . '_heading')); $output .= "\n\t\t\t" . $tabs_nav; $output .= "<div class='tab-box tabs-container'>"; $output .= "\n\t\t\t" . wpb_js_remove_wpautop($content); $output .= "</div></div></div>"; echo !empty($output) ? $output : '';
$li_span_class = $this->spanClass($grid_columns_count); $css_class = 'wpb_row wpb_teaser_grid wpb_content_element ' . $this->getMainCssClass($filter) . ' columns_count_' . $grid_columns_count . ' columns_count_' . $grid_columns_count . ' ' . $post_types_teasers; // Css classes by selected post types $class_to_filter = $css_class; $class_to_filter .= $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts); $this->setLinkTarget($grid_link_target); ?> <div class="<?php echo esc_attr(trim($css_class)); ?> "> <div class="wpb_wrapper"> <?php echo wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_teaser_grid_heading')); ?> <div class="teaser_grid_container"> <?php if ('yes' === $filter && !empty($this->filter_categories)) { $categories_array = $this->getFilterCategories(); echo '<ul class="categories_filter vc_col-sm-12 vc_clearfix">' . '<li class="active"><a href="#" data-filter="*">'; _e('All', 'js_composer'); echo '</a></li>'; foreach ($this->getFilterCategories() as $cat) { echo '<li><a href="#"' . ' data-filter=".grid-cat-<?php echo $cat->term_id ?>">' . esc_attr($cat->name) . '</a></li>'; } echo '</ul>'; ?> <div class="vc_clearfix"></div> <?php
* @var $show_bg * @var $sidebar_id * Shortcode class * @var $this WPBakeryShortCode_VC_Widget_sidebar */ $title = $el_class = $sidebar_id = $show_bg = ''; $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); if ('' === $sidebar_id) { return null; } $el_class = $this->getExtraClass($el_class); if ('true' === $show_bg) { $el_class .= ' solid-bg'; } ob_start(); dynamic_sidebar($sidebar_id); $sidebar_value = ob_get_contents(); ob_end_clean(); $sidebar_value = trim($sidebar_value); $sidebar_value = '<li' === substr($sidebar_value, 0, 3) ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_widgetised_column wpb_content_element sidebar-content' . $el_class, $this->settings['base'], $atts); $output = ' <div class="' . esc_attr($css_class) . '"> <div class="wpb_wrapper"> ' . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_widgetised_column_heading')) . ' ' . $sidebar_value . ' </div> </div> '; echo $output;
function vc_theme_vc_video($atts) { $output = $title = $link = $size = $el_class = $img_src = ''; extract(shortcode_atts(array('title' => '', 'link' => 'http://vimeo.com/23237102', 'size' => isset($content_width) ? $content_width : 500, 'popup' => 'no', 'img' => '', 'img_size' => '300x200', 'el_class' => '', 'css' => ''), $atts)); if ($link == '') { return null; } $src = ''; if ($popup == 'yes') { $img_size = explode('x', $img_size); $width = $img_size[0]; $height = $img_size[1]; if ($img != '') { $src = etheme_get_image($img, $width, $height); } elseif ($img_src != '') { $src = do_shortcode($img_src); } $text = __('Show video', ETHEME_DOMAIN); if ($src != '') { $text = '<img src="' . $src . '">'; } } $video_w = isset($content_width) ? $content_width : 500; $video_h = $video_w / 1.61; //1.61 golden ratio global $wp_embed; $embed = $wp_embed->run_shortcode('[embed width="' . $video_w . '"' . $video_h . ']' . $link . '[/embed]'); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_video_widget wpb_content_element' . $el_class . $el_class . vc_shortcode_custom_css_class($css, ' '), 'vc_video'); $rand = rand(1000, 9999); $css_class .= ' video-' . $rand; $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_video_heading')); if ($popup == 'yes') { $output .= '<a href="#" class="open-video-popup">' . $text . '</a>'; $output .= "\n\t" . '<script type="text/javascript">'; $output .= "\n\t\t" . 'jQuery(document).ready(function() { jQuery(".video-' . $rand . ' .open-video-popup").magnificPopup({ items: [ { src: "' . $link . '", type: "iframe" }, ], }); });'; $output .= "\n\t" . '</script> '; } else { $output .= '<div class="wpb_video_wrapper">' . $embed . '</div>'; } $output .= "\n\t\t" . '</div> '; $output .= "\n\t" . '</div> '; return $output; }
if (in_array("prettyphoto", $tmp_class)) { wp_enqueue_script('prettyphoto'); wp_enqueue_style('prettyphoto'); $a_class = ' class="prettyphoto"'; $el_class = str_ireplace(" prettyphoto", "", $el_class); } } $link_to = ''; if ($img_link_large == true) { $link_to = wp_get_attachment_image_src($img_id, 'large'); $link_to = $link_to[0]; } else { if (!empty($img_link)) { $link_to = $img_link; } } if (!empty($link_to) && !preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) { $link_to = 'http://' . $link_to; } $img_output = $style == 'vc_box_shadow_3d' ? '<span class="vc_box_shadow_3d_wrap">' . $img['thumbnail'] . '</span>' : $img['thumbnail']; $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . ($img_link_target != '_self' ? ' target="' . $img_link_target . '"' : '') . '>' . $img_output . '</a>' : $img_output; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_single_image wpb_content_element' . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']); $css_class .= $this->getCSSAnimation($css_animation); $css_class .= ' vc_align_' . $alignment; $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= "\n\t\t\t" . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading')); $output .= "\n\t\t\t" . $image_string; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_single_image'); echo $output;
pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [' . implode(',', $values) . '] }'; } else { $color_a[3] = 0.8; $data_[] = '{ label: "' . esc_js($set[0]) . '", color: "' . om_rgba2string($color) . '", highlight: "' . om_rgba2string($color_a) . '", value: ' . $values[0] . ' }'; } } echo '<div class="' . implode(' ', $classes) . '"' . (!empty($styles) ? ' style="' . implode(';', $styles) . '"' : '') . '>'; echo wpb_widget_title(array('title' => $title, 'extraclass' => 'vc_om-chart_heading')); echo '<canvas id="' . $id . '" width="' . $width . '" height="' . $height . '"></canvas>'; echo '<script>'; $side_color = $labels_color ? $labels_color : get_option(OM_THEME_PREFIX . 'side_text_color'); $lines_color = om_parse2rgba($side_color); $grid_color = $lines_color; $backdrop_color = $lines_color; $lines_color[3] = 0.25; $lines_color = om_rgba2string($lines_color); $grid_color[3] = 0.12; $grid_color = om_rgba2string($grid_color); $backdrop_color = om_rgb2hsl($backdrop_color); if ($backdrop_color[2] <= 0.7) { $backdrop_color[2] += 0.5; } else { $backdrop_color[2] -= 0.5;
protected function content($atts, $content = null) { $el_position = $title = $width = $el_class = $sidebar_id = ''; extract(shortcode_atts(array('el_position' => '', 'title' => '', 'width' => '1/1', 'el_class' => '', 'sidebar_id' => '', 'top_margin' => 'none'), $atts)); if ($sidebar_id == '') { return null; } $output = ''; $el_class = $this->getExtraClass($el_class); $width = ''; //wpb_translateColumnWidthToSpan($width); ob_start(); dynamic_sidebar($sidebar_id); $sidebar_value = ob_get_contents(); ob_end_clean(); $sidebar_value = trim($sidebar_value); $sidebar_value = substr($sidebar_value, 0, 3) == '<li' ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value; // $output .= "\n\t" . '<div class="wpb_widgetised_column wpb_content_element clearfix' . $width . $el_class . ($top_margin != "none" ? ' ' . $top_margin : '') . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; //$output .= ($title != '' ) ? "\n\t\t\t".'<h2 class="wpb_heading wpb_widgetised_column_heading">'.$title.'</h2>' : ''; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_widgetised_column_heading')); $output .= "\n\t\t\t" . $sidebar_value; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); // $output = $this->startRow($el_position) . $output . $this->endRow($el_position); return $output; }
$tab_titles = array(); /** * vc_tabs * */ if (isset($matches[1])) { $tab_titles = $matches[1]; } $tabs_nav = ''; $tabs_nav .= '<ul class="wpb_tabs_nav ui-tabs-nav vc_clearfix">'; foreach ($tab_titles as $tab) { $tab_atts = shortcode_parse_atts($tab[0]); if (isset($tab_atts['title'])) { $tabs_nav .= '<li><a href="#tab-' . (isset($tab_atts['tab_id']) ? $tab_atts['tab_id'] : sanitize_title($tab_atts['title'])) . '">' . $tab_atts['title'] . '</a></li>'; } } $tabs_nav .= '</ul>'; $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim($element . ' wpb_content_element ' . $el_class), $this->settings['base'], $atts); if ('vc_tour' === $this->shortcode) { $next_prev_nav = '<div class="wpb_tour_next_prev_nav vc_clearfix"> <span class="wpb_prev_slide"><a href="#prev" title="' . __('Previous tab', 'js_composer') . '">' . __('Previous tab', 'js_composer') . '</a></span> <span class="wpb_next_slide"><a href="#next" title="' . __('Next tab', 'js_composer') . '">' . __('Next tab', 'js_composer') . '</a></span></div>'; } else { $next_prev_nav = ''; } $output = ' <div class="' . $css_class . '" data-interval="' . $interval . '"> <div class="wpb_wrapper wpb_tour_tabs_wrapper ui-tabs vc_clearfix"> ' . wpb_widget_title(array('title' => $title, 'extraclass' => $element . '_heading')) . $tabs_nav . wpb_js_remove_wpautop($content) . $next_prev_nav . ' </div> </div> '; echo $output;
$subtitle = '<p class="single-line">' . $subtitle . '</p>'; } $count = 1; $accordionID = uniqid('accordion-'); while (($letter_pos = strpos($content, '[vc_accordion_tab')) !== false) { if ($group_panels !== 'false') { if ($active_tab == $count) { $replaceText = '[panel parent="' . $accordionID . '" active="true"'; } else { $replaceText = '[panel parent="' . $accordionID . '"'; } } else { if ($active_tab == $count) { $replaceText = '[panel active="true"'; } else { $replaceText = '[panel'; } } $replaceTextCount = strlen('[vc_accordion_tab'); $count++; $content = substr_replace($content, $replaceText, $letter_pos, $replaceTextCount); } $content = str_replace('[panel', '[vc_accordion_tab', $content); $el_class = $this->getExtraClass($el_class); $panel_class = !empty($accordion_style) ? $accordion_style : 'style-1'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'accordion-title-' . $accordion_style)); $output .= "\n\t\t" . $subtitle; $output .= "\n\t\t\t" . '<div id="' . $accordionID . '" class="panel-group-faq ' . $panel_class . ' panel-group">'; $output .= "\n\t\t\t\t" . wpb_js_remove_wpautop($content); $output .= "\n\t\t\t" . '</div> ' . $this->endBlockComment('.panel-group'); echo $output;
function portfolio($atts, $content = null) { $atts = vc_map_get_attributes('portfolio', $atts); extract($atts); wp_enqueue_script('isotop'); $out = $sidebar = $isotope = $grid = $width = $height = $thumb = $with_title = $mediatitle = $args = $my_query = $portfolio_taxs = $without_padding = $cats_array = ''; global $paged; if ($cats) { $cats_array = explode(",", $cats); $args = array('post_type' => 'portfolio', 'posts_per_page' => $number, 'paged' => $paged, 'tax_query' => array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cats_array))); } else { $args = array('post_type' => 'portfolio', 'posts_per_page' => $number, 'paged' => $paged); } $my_query = new WP_Query($args); if ($pagination != 'yes' && $filters == 'yes') { if (is_array($my_query->posts) && !empty($my_query->posts)) { foreach ($my_query->posts as $my_post) { $post_taxs = wp_get_post_terms($my_post->ID, 'portfolio_category', array("fields" => "all")); if (is_array($post_taxs) && !empty($post_taxs)) { foreach ($post_taxs as $post_tax) { if (is_array($cats_array) && !empty($cats_array) && (in_array($post_tax->term_id, $cats_array) || in_array($post_tax->parent, $cats_array))) { $portfolio_taxs[urldecode($post_tax->slug)] = $post_tax->name; } if (empty($cats_array) || !isset($cats_array)) { $portfolio_taxs[urldecode($post_tax->slug)] = $post_tax->name; } } } } } $all_terms = get_terms('portfolio_category'); if (!empty($all_terms) && is_array($all_terms)) { foreach ($all_terms as $term) { if ($portfolio_taxs[urldecode($term->slug)]) { $sorted_taxs[urldecode($term->slug)] = $term->name; } } } $portfolio_taxs = $sorted_taxs; $portfolio_category = get_terms('portfolio_category'); } if ($layout_mode == 'masonry') { $isotope = ' data-layout-mode="masonry"'; $width = 515; $height = 9999; $thumb = 'portfolio_masonry'; } else { $isotope = ' data-layout-mode="fitRows"'; $width = 515; $height = 339; $thumb = 'portfolio'; } if ($column == '2') { $grid = 'grid_6'; } else { if ($column == '3') { $grid = 'grid_4'; } else { $grid = 'grid_3'; } } if ($desc != 'yes') { $with_title = 'with_title'; } else { $mediatitle = ' no_title_thumb'; } if ($padding == 'yes') { $without_padding = ' nospace'; } $out .= '<div class="wpb_content_element portfolios_wrap column_' . $column . '">'; $out .= wpb_widget_title(array('title' => $title)); $out .= '<div class="posts_layout grids_wrap">'; $out .= '<div class="row_inner clearfix">'; if (is_array($portfolio_taxs) && !empty($portfolio_taxs) && $filters == 'yes') { $out .= '<div class="filterable grid_12">'; $out .= '<ul class="categories_filter clearfix">'; $out .= '<li class="active"><a data-filter="*" href="#">' . __('All', 'corporative') . '</a></li>'; foreach ($portfolio_taxs as $portfolio_cat_slug => $portfolio_cat_name) { $out .= '<li><a data-filter=".' . $portfolio_cat_slug . '" href="#">' . $portfolio_cat_name . '</a></li>'; } $out .= '</ul>'; $out .= '</div>'; } $out .= '</div>'; $out .= '<div class="row_inner clearfix">'; $out .= '<ul class="grid_layout"' . $isotope . ' clearfix>'; while ($my_query->have_posts()) { $my_query->the_post(); $gallery = $videoURL = $format = $categories_css = ''; if (get_field('portfolio_gallery')) { $gallery = get_field('portfolio_gallery'); } if (get_field('portfolio_video')) { $videoURL = get_field('portfolio_video'); } if (get_field('portfolio_format') == 'video') { $format = 'Video'; } elseif (get_field('portfolio_format') == 'gallery') { $format = 'Gallery'; } else { $format = 'Standard'; } $item_classes = ''; $item_cats = get_the_terms(get_the_ID(), 'portfolio_category'); if ($item_cats) { foreach ($item_cats as $item_cat) { $item_classes .= urldecode($item_cat->slug) . ' '; } } $out .= '<li id="' . get_the_ID() . '" class="grid_item ' . $grid . $without_padding . $mediatitle . ' ' . $item_classes . '">'; $out .= mediaholder_caption($with_title, $format, $width, $height, $thumb, $videoURL, '', $gallery); if ($desc == 'yes') { $out .= '<div class="folio-desc">'; $out .= '<h2 class="post_title"> <a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></h2>'; if ($cats_info == 'yes') { $out .= '<p class="folio-cats">' . get_the_term_list(get_the_ID(), 'portfolio_category', '', ', ', '') . '</p>'; } $out .= excerpt($excerpt); if ($view_project == 'yes' && $view_project_text != '') { $out .= '<div class="folio-more"><a href="' . get_permalink() . '"><span>' . $view_project_text . ' </span></a></div>'; } $out .= '</div>'; } $out .= '</li>'; } wp_reset_postdata(); $out .= '</ul>'; $out .= '</div>'; if ($pagination == 'yes') { $out .= new_pagination($my_query->max_num_pages); } $out .= '</div>'; $out .= '</div>'; return $out; }
<?php extract(shortcode_atts(array('title' => '', 'images' => '', 'onclick' => '', 'custom_links' => '', 'links_target' => '', 'img_size' => 'full', 'el_class' => ''), $atts)); if ($images == '') { return false; } $images = explode(',', $images); if ($el_class) { $el_class = ' ' . $el_class; } if ($onclick == 'custom_link') { $custom_links = explode(',', $custom_links); } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_om-logos wpb_content_element' . $el_class, $this->settings['base'], $atts); echo '<div class="' . $css_class . '">' . wpb_widget_title(array('title' => $title, 'extraclass' => 'vc_om-logos_heading')) . '<div class="vc_om-logos-inner">'; foreach ($images as $i => $id) { $src = om_img_any_resize($id, $img_size, false, false); if ($src) { if (get_option(OM_THEME_PREFIX . 'lazyload') == 'true') { $img = '<img width="' . $src[1] . '" height="' . $src[2] . '" src="' . TEMPLATE_DIR_URI . '/img/e.png" data-original="' . $src[0] . '" alt="" class="lazyload" />'; } else { $img = '<img width="' . $src[1] . '" height="' . $src[2] . '" src="' . $src[0] . '" alt=""/>'; } if ($onclick == 'custom_link') { if (isset($custom_links[$i])) { $img = '<a href="' . esc_attr($custom_links[$i]) . '"' . ($links_target ? ' target="' . $links_target . '"' : '') . '>' . $img . '</a>'; } } elseif ($onclick == 'description') { $attachment = get_post($id); $href = trim($attachment->post_content); if ($href) {
} /** * Shortcode attributes * @var $atts * @var $el_class * @var $title * @var $flickr_id * @var $count * @var $type * @var $display * @var $css * Shortcode class * @var $this WPBakeryShortCode_VC_flickr */ $el_class = $title = $flickr_id = $css = $count = $type = $display = ''; $output = ''; $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $class_to_filter = 'wpb_flickr_widget wpb_content_element'; $class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts); $output = ' <div class="' . esc_attr($css_class) . '"> <div class="wpb_wrapper"> ' . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_flickr_heading')) . ' <script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=' . $count . '&display=' . $display . '&size=s&layout=x&source=' . $type . '&' . $type . '=' . $flickr_id . '"></script> <p class="flickr_stream_wrap"><a class="wpb_follow_btn wpb_flickr_stream" href="http://www.flickr.com/photos/' . $flickr_id . '">' . __('View stream on flickr', 'js_composer') . '</a></p> </div> </div> '; echo $output;
$link_image_end = '</a>'; } else { $link_image_start = ''; $link_image_end = ''; } $description = ''; if ($slides_content != '' && $content != '' && ($type == ' wpb_flexslider flexslider_fade flexslider' || $type == ' wpb_flexslider flexslider_slide flexslider')) { $description = '<div class="flex-caption">'; if ($slides_title == true) { $description .= '<h2 class="post-title">' . $link_image_start . $post_title . $link_image_end . '</h2>'; } $description .= $content; $description .= '</div>'; } $teasers .= $el_start . $link_image_start . $thumbnail . $link_image_end . $description . $el_end; } // endwhile loop wp_reset_query(); if ($teasers) { $teasers = $slides_wrap_start . $teasers . $slides_wrap_end; } else { $teasers = __("Nothing found.", "js_composer"); } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_gallery wpb_posts_slider wpb_content_element' . $el_class, $this->settings['base']); $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_posts_slider_heading')); $output .= '<div class="wpb_gallery_slides' . $type . '" data-interval="' . $interval . '"' . $flex_fx . '>' . $teasers . '</div>'; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_gallery'); echo $output;
protected function content($atts, $content = null) { wp_enqueue_style('ui-custom-theme'); wp_enqueue_script('jquery-ui-accordion'); $title = $interval = $width = $el_position = $el_class = ''; // extract(shortcode_atts(array('title' => '', 'interval' => 0, 'width' => '1/1', 'el_position' => '', 'el_class' => '', 'top_margin' => 'none', 'active' => 1), $atts)); $output = ''; $el_class = $this->getExtraClass($el_class); $width = ''; //wpb_translateColumnWidthToSpan($width); /*$output .= "\n\t".'<div class="wpb_accordion wpb_content_element '.$width.$el_class.' not-column-inherit">'; //data-interval="'.$interval.'" $output .= "\n\t\t".'<div class="wpb_wrapper wpb_accordion_wrapper ui-accordion">'; //$output .= ($title != '' ) ? "\n\t\t\t".'<h2 class="wpb_heading wpb_accordion_heading">'.$title.'</h2>' : ''; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_accordion_heading')); $output .= "\n\t\t\t".wpb_js_remove_wpautop($content); $output .= "\n\t\t".'</div> '.$this->endBlockComment('.wpb_wrapper'); $output .= "\n\t".'</div> '.$this->endBlockComment($width);*/ $output .= "\n\t\t" . '<ul class="accordion' . $width . $el_class . ($top_margin != "none" ? ' ' . $top_margin : '') . ((int) $active == 1 ? ' accordion-active' : '') . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_accordion_heading')); $output .= "\n\t\t\t" . wpb_js_remove_wpautop($content); $output .= "\n\t\t" . '</ul> ' . $this->endBlockComment('.wpb_wrapper') . $this->endBlockComment($width); // $output = $this->startRow($el_position) . $output . $this->endRow($el_position); return $output; }
if (in_array("animated", $options)) { $bar_options .= " animated"; } if (in_array("striped", $options)) { $bar_options .= " striped"; } if ($bgcolor == "custom" && $custombgcolor != '') { $custombgcolor = ' style="' . vc_get_css_color('background-color', $custombgcolor) . '"'; $bgcolor = ""; } if ($bgcolor != "") { $bgcolor = " " . $bgcolor; } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_progress_bar wpb_content_element' . $el_class, $this->settings['base'], $atts); $output = '<div class="' . $css_class . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_progress_bar_heading')); $graph_lines = explode(",", $values); $max_value = 0.0; $graph_lines_data = array(); foreach ($graph_lines as $line) { $new_line = array(); $color_index = 2; $data = explode("|", $line); $new_line['value'] = isset($data[0]) ? $data[0] : 0; $new_line['percentage_value'] = isset($data[1]) && preg_match('/^\\d{1,2}\\%$/', $data[1]) ? (double) str_replace('%', '', $data[1]) : false; if ($new_line['percentage_value'] != false) { $color_index += 1; $new_line['label'] = isset($data[2]) ? $data[2] : ''; } else { $new_line['label'] = isset($data[1]) ? $data[1] : ''; }
<?php $output = ''; $atts = vc_map_get_attributes($this->getShortcode(), $atts); extract($atts); $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'widget wpb_flickr_widget wpb_content_element' . $el_class, $this->settings['base'], $atts); $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'widget_title wpb_flickr_heading')); $output .= "\n\t\t\t" . '<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=' . $count . '&display=' . $display . '&size=s&layout=x&source=' . $type . '&' . $type . '=' . $flickr_id . '"></script>'; $output .= "\n\t\t\t" . '<p class="flickr_stream_wrap"><a class="wpb_follow_btn wpb_flickr_stream" href="http://www.flickr.com/photos/' . $flickr_id . '">' . esc_html__("View stream on flickr", 'training') . '</a></p>'; $output .= "\n\t\t" . '</div>' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div>' . $this->endBlockComment('.wpb_flickr_widget') . "\n"; echo trim($output);
<?php wp_enqueue_script('jquery-ui-accordion'); $output = $title = $interval = $el_class = $collapsible = $active_tab = ''; // extract(shortcode_atts(array('title' => '', 'interval' => 0, 'el_class' => '', 'collapsible' => 'no', 'active_tab' => '1'), $atts)); $unique_id = rand(1, 10000); $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_accordion wpb_content_element ' . $el_class . ' not-column-inherit', $this->settings['base']); $output .= "\n\t" . '<div class="' . $css_class . '">'; //data-interval="'.$interval.'" $output .= "\n\t\t" . '<div class="wpb_wrapper wpb_accordion_wrapper hb-accordion" id="hb-accordion-' . $unique_id . '" data-initialindex="' . $active_tab . '">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_accordion_heading')); $output .= "\n\t\t\t" . wpb_js_remove_wpautop($content); $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_accordion'); echo $output;
public function products($atts, $contents) { self::$int++; $int = self::$int; if (!class_exists('WooCommerce')) { return false; } $atts = shortcode_atts(array('title' => '', 'product_layout' => '', 'product_banner' => '', 'product_banner_align' => 'center', 'product_group' => 'products_categories', 'product_cat_ids' => '', 'product_ids' => '', 'product_skus' => '', 'product_orderby' => 'date', 'product_order' => 'DESC', 'after_content' => '', 'before_content' => '', 'max_items' => '10', 'img_size' => 'shop_catalog_image_size', 'el_class' => '', 'css' => '', 'width' => '1/3', 'offset' => ''), $atts); // Add Class $width = $css = ''; $width = wpb_translateColumnWidthToSpan($atts['width']); $width = vc_column_offset_class_merge($atts['offset'], $width); $__width = array(); $__width = explode(' ', $width); $parent_class = array(); $item_class = array(); if (is_array($__width)) { foreach ($__width as $__class) { if (strpos($__class, 'hidden') > 0) { $parent_class[] = $__class; } else { $item_class[] = $__class; } } //$width = implode($item_class, ' '); } $parent_class[] = vc_shortcode_custom_css_class($atts['css']); $parent_class[] = $atts['product_styles']; $parent_class[] = 'woocommerce'; if (!empty($atts['el_class'])) { $parent_class[] = $atts['el_class']; } $layout = ''; if ($atts['product_layout'] == 'tab') { $parent_class[] = 'mTheme-products-tab'; } else { $layout = $atts['product_layout']; } $columns = m_wedding_translateColumnWidthVC($atts['width']); //$css_classes = array( //'wpb_column', //'vc_column_container', //$width //); // Query $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => $atts['max_items']); if ($atts['product_group'] == 'recent_products') { $args = array_merge($args, array('ignore_sticky_posts' => 1, 'orderby' => $atts['product_orderby'], 'order' => $atts['product_order'], 'meta_query' => WC()->query->get_meta_query())); } elseif ($atts['product_group'] == 'featured_products') { $meta_query = WC()->query->get_meta_query(); $meta_query[] = array('key' => '_featured', 'value' => 'yes'); $args = array_merge($args, array('ignore_sticky_posts' => 1, 'orderby' => $atts['product_orderby'], 'order' => $atts['product_order'], 'meta_query' => $meta_query)); } elseif ($atts['product_group'] == 'sale_products') { $args = array_merge($args, array('no_found_rows' => 1, 'orderby' => $atts['product_orderby'], 'order' => $atts['product_order'], 'meta_query' => WC()->query->get_meta_query(), 'post__in' => array_merge(array(0), wc_get_product_ids_on_sale()))); } elseif ($atts['product_group'] == 'best_selling_products') { $args = array_merge($args, array('ignore_sticky_posts' => 1, 'meta_key' => 'total_sales', 'orderby' => 'meta_value_num', 'meta_query' => WC()->query->get_meta_query())); } elseif ($atts['product_group'] == 'top_rated_products') { $args = array_merge($args, array('ignore_sticky_posts' => 1, 'orderby' => $atts['product_orderby'], 'order' => $atts['product_order'], 'meta_query' => WC()->query->get_meta_query())); add_filter('posts_clauses', array('WC_Shortcodes', 'order_by_rating_post_clauses')); } elseif ($atts['product_group'] == 'products_categories') { if (isset($atts['product_cat_ids'])) { $term_ids = explode(',', $atts['product_cat_ids']); $term_ids = array_map('trim', $term_ids); } else { $term_ids = array(); } $args = array_merge($args, array('ignore_sticky_posts' => 1, 'orderby' => $atts['product_orderby'], 'order' => $atts['product_order'], 'meta_query' => WC()->query->get_meta_query(), 'tax_query' => array(array('taxonomy' => 'product_cat', 'terms' => $term_ids, 'field' => 'term_id')))); } else { $post__in = ''; if (!empty($atts['product_ids'])) { $post__in = array_map('trim', explode(',', $atts['product_ids'])); } $args = array_merge($args, array('ignore_sticky_posts' => 1, 'meta_query' => WC()->query->get_meta_query(), 'post__in' => $post__in)); if (!empty($atts['product_skus'])) { $args['meta_query'][] = array('key' => '_sku', 'value' => array_map('trim', explode(',', $atts['product_skus'])), 'compare' => 'IN'); } } $query = new WP_Query($args); ob_start(); echo '<div id="mtheme-products-' . $int . '" class="mtheme-products ' . join($parent_class, ' ') . '">'; if (!empty($atts['title']) || !empty($atts['before_content'])) { echo '<div class="mtheme-title">'; if (!empty($atts['title'])) { echo wpb_widget_title(array('title' => $atts['title'], 'extraclass' => 'wpb_singleimage_heading')); } if (!empty($atts['before_content'])) { echo '<div class="before-content">' . $atts['before_content'] . '</div>'; } echo '</div>'; } echo '<div class="mtheme-products-inner">'; $template = self::mTheme_get_template_part('content-products', $layout); if (file_exists("{$template}")) { if ($query->have_posts()) { require "{$template}"; } else { echo __('Not empty', 'mTheme'); } } echo '</div>'; if (!empty($contents)) { echo '<div class="after-content">' . $contents . '</div>'; } echo "</div>"; if ($atts['product_group'] == 'top_rated_products') { remove_filter('posts_clauses', array('WC_Shortcodes', 'order_by_rating_post_clauses')); } wp_reset_postdata(); return ob_get_clean(); }
function portfolio_carousel($atts, $content = null) { $atts = vc_map_get_attributes('portfolio_carousel', $atts); extract($atts); if ($img_size == '') { $value = 'portfolio'; } wp_enqueue_style('owl-carousel'); wp_enqueue_script('owl-carousel'); $out = $args = $my_query = $animated = $animated_data = ''; if ($cats) { $cats_array = explode(",", $cats); $args = array('post_type' => 'portfolio', 'posts_per_page' => $number, 'tax_query' => array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cats_array))); } else { $args = array('post_type' => 'portfolio', 'posts_per_page' => $number); } $my_query = new WP_Query($args); if ($css_animation != '') { $animated = ' animated '; $animated_data = ' data-gen="' . $css_animation . '"'; } if ($out_title != 'yes') { $withtitle = 'with_title'; $no_title_thumb = ''; } else { $withtitle = ''; $no_title_thumb = ' class="no_title_thumb"'; } $out .= '<div class="wpb_content_element portfolio_carousel_wrap clearfix' . $animated . '"' . $animated_data . '>'; $out .= wpb_widget_title(array('title' => $title)); if ($padding == 'carousel_padding') { $out .= '<div class="' . $padding . '">'; } $out .= '<div class="rd_carousel' . $outer_navigation . '" data-grid="' . $grid . '" data-tablet="' . $tablet . '" data-tabletsmall="' . $tabletsmall . '" data-mobile="' . $mobile . '" data-mobilesmall="' . $mobilesmall . '" data-navigation="' . $navigation . '" data-auto="' . $autoplay . '" data-pagination="' . $pagination . '">'; while ($my_query->have_posts()) { $my_query->the_post(); $gallery = $videoURL = $format = ''; if (get_field('portfolio_gallery')) { $gallery = get_field('portfolio_gallery'); } if (get_field('portfolio_video')) { $videoURL = get_field('portfolio_video'); } if (get_field('portfolio_format') == 'video') { $format = 'Video'; } elseif (get_field('portfolio_format') == 'gallery') { $format = 'Gallery'; } else { $format = 'Standard'; } $out .= '<div id="post-' . get_the_ID() . '"' . $no_title_thumb . '>'; $out .= mediaholder_gal_caption($withtitle, $format, 300, 300, $img_size, $videoURL, '', $gallery); if ($out_title == 'yes') { $out .= '<div class="detailholder">'; $out .= '<h2><a href="' . get_permalink(get_the_ID()) . '" title="' . get_the_title(get_the_ID()) . '">' . get_the_title(get_the_ID()) . '</a></h2>'; $out .= '<span class="p_bottom_cat">' . get_the_term_list(get_the_ID(), 'portfolio_category', '', ', ', '') . '</span>'; $out .= '</div>'; } $out .= '</div>'; } wp_reset_postdata(); $out .= '</div>'; if ($padding == 'carousel_padding') { $out .= '</div>'; } if ($view_portfolio == 'yes') { if ($view_portfolio_text != '' && $view_portfolio_url) { $out .= '<div class="show_all"><a href="' . $view_portfolio_url . '"><span>' . $view_portfolio_text . '</span></a></div>'; } } $out .= '</div>'; return $out; }
function posts($atts, $content = null) { $atts = vc_map_get_attributes('posts', $atts); extract($atts); if ($column != 1) { wp_enqueue_script('isotop'); } $out = $grid = $metaAuthor = $date = $comments = $views = $category = $thumb = $width = $height = $isotope = $format_icon = $args = $my_query = ''; global $paged; $args = array('post_type' => 'post', 'category_name' => $cats, 'pagination' => true, 'posts_per_page' => $number, 'ignore_sticky_postss' => 1, 'paged' => $paged); $my_query = new WP_Query($args); if ($column == 1) { $grid = 'grid_12'; $metaAuthor = $date = $comments = $views = $category = 'view'; if ($social == 1) { $thumb = 'blog_column1_bar_share'; $width = 706; $height = 350; } else { $thumb = 'blog_column1_bar'; $width = 786; $height = 380; } } else { if ($column == 2) { $grid = 'grid_6'; $metaAuthor = $date = $comments = 'view'; } if ($column == 3) { $grid = 'grid_4'; $date = $comments = 'view'; } if ($layout_mode == 'masonry') { $thumb = 'blog_masonry'; $width = 697; $height = 9999; } else { $thumb = 'blog_nomasonry'; $width = 697; $height = 480; } } $grids_wrap = ' grids_wrap'; if ($layout_mode == 'masonry' && $column != 1) { $isotope = ' data-layout-mode="masonry"'; } if ($layout_mode == 'fitRows' && $column != 1) { $isotope = ' data-layout-mode="fitRows"'; } if ($column == 1) { $grids_wrap = ''; } if ($social != 'yes') { $format_icon = ' hide_angle'; } $out .= '<div class="wpb_content_element posts_wrap column_' . $column . '">'; $out .= wpb_widget_title(array('title' => $title)); $out .= '<div class="posts_layout' . $grids_wrap . '">'; $out .= '<div class="row_inner clearfix">'; $out .= '<ul class="grid_layout"' . $isotope . '>'; while ($my_query->have_posts()) { $my_query->the_post(); $disqus_shortname = $gallery = $audioURL = $videoURL = $format = $icon = $post_comment = ''; if (get_field('post_gallery')) { $gallery = get_field('post_gallery'); } if (get_field('post_video')) { $videoURL = get_field('post_video'); } if (get_field('post_audio')) { $audioURL = get_field('post_audio'); } if (has_post_format('video')) { $icon = 'icons-play'; $format = __('Video', 'corporative'); } elseif (has_post_format('audio')) { $icon = 'icons-music'; $format = __('Audio', 'corporative'); } elseif (has_post_format('gallery')) { $icon = 'icons-sliders-vertical'; $format = __('Gallery', 'corporative'); } else { $icon = 'icons-document-fill'; $format = ''; } if (get_field('post_comment')) { $post_comment = get_field('post_comment'); } if ($post_comment == 'comment_default' || empty($post_comment)) { $post_comment = rd_options('reedwan_post_comment'); } if ($post_comment == 'comment_disqus') { $disqus_shortname = rd_options('reedwan_disqus_shortname'); } $out .= '<li id="post-' . get_the_ID() . '" class="grid_item no_title_thumb ' . $grid . '">'; $out .= '<div class="post_b">'; if ($social == 'yes') { $out .= '<a href="' . get_permalink() . '" class="post_format lefttip" title="' . $format . '"><i class="' . $icon . '"></i></a>'; $out .= '<div class="social post_social">'; $out .= '<a href="http://twitter.com/home?status=' . get_the_title() . ' ' . get_permalink() . '" target="_blank" class="lefttip" title="Twitter"><i class="icons-social-twitter"></i></a>'; $thumbx = ''; $thumbx = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'facebook'); $out .= '<a href="http://www.facebook.com/sharer.php?s=100&p[title]=' . urlencode(get_the_title()) . '&p[summary]=' . urlencode(get_the_excerpt()) . '&p[url]=' . urlencode(get_permalink()) . '&p[images][0]=' . urlencode($thumbx[0]) . '" target="_blank" class="lefttip" title="Facebook"><i class="icons-social-facebook"></i></a>'; $out .= '<a href="https://plus.google.com/share?url=' . get_permalink() . '" onclick="javascript:window.open(this.href,"", "menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600");return false;" target="_blank" class="lefttip" title="Google Plus"><i class="icons-social-google-plus"></i></a>'; $thumby = ''; $thumby = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $out .= '<a href="http://pinterest.com/pin/create/button/?url=' . urlencode(get_permalink()) . '&description=' . urlencode(get_the_title()) . '&media=' . urlencode($thumby[0]) . '" target="_blank" class="lefttip" title="Pinterest"><i class="icons-social-pinterest"></i></a>'; $out .= '</div>'; } $out .= '<div class="post_content' . $format_icon . '">'; if ($layout_mode == 'masonry') { $out .= mediaholder('', $format, $thumb, $videoURL, $audioURL, $gallery); } else { $out .= mediaholder_caption('', $format, $width, $height, $thumb, $videoURL, $audioURL, $gallery); } $out .= '<div class="post_inner_content clearfix">'; $out .= '<h2 class="post_title"> <a href="' . get_permalink() . '" title="">' . get_the_title() . '</a></h2>'; if ($meta == 'yes') { $out .= '<div class="f_meta clearfix">'; $out .= post_meta($disqus_shortname, $metaAuthor, $date, $comments, $views, $category); $out .= '</div>'; } $out .= excerpt($excerpt); if ($more == 'yes') { $out .= '<div class="right more"><a href="' . get_permalink() . '">' . __('Read More', 'corporative') . ' →</a></div>'; } $out .= '</div>'; $out .= '</div>'; $out .= '</div>'; $out .= '</li>'; } wp_reset_postdata(); $out .= '</ul>'; $out .= '</div>'; if ($pagination == 'yes') { $out .= new_pagination($my_query->max_num_pages); } $out .= '</div>'; $out .= '</div>'; return $out; }
<?php $output = $title = $link = $size = $el_class = ''; extract(shortcode_atts(array('title' => '', 'link' => 'http://vimeo.com/92033601', 'size' => isset($content_width) ? $content_width : 500, 'el_class' => '', 'css' => '', 'frame' => ''), $atts)); if ($link == '') { return null; } $el_class = $this->getExtraClass($el_class); $video_w = isset($content_width) ? $content_width : 500; $video_h = $video_w / 1.61; //1.61 golden ratio global $wp_embed; $embed = $wp_embed->run_shortcode('[embed width="' . $video_w . '"' . $video_h . ']' . $link . '[/embed]'); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_video_widget wpb_content_element' . $el_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts); $frame_class = $frame_before = $frame_after = ''; if ($frame == 'ipad') { $frame_class = ' fitvid'; $frame_before = '<div class="frame-video">'; $frame_after = '</div>'; } $output .= "\n\t" . '<div class="' . $css_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper">'; $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_video_heading')); $output .= $frame_before; $output .= '<div class="wpb_video_wrapper' . $frame_class . '">' . $embed . '</div>'; $output .= $frame_after; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_video_widget'); echo $output;
$animate_label = 1; if ($label_type == 'title' || $label_type == 'icon') { $animate_label = 0; } $vc_pie_chart_value = ''; if ($label_type == 'title') { $vc_pie_chart_value = $title; } elseif ($label_type == 'icon') { $iconClass = isset(${"icon_" . $icon_type}) ? ${"icon_" . $icon_type} : ''; if ($iconClass) { vc_icon_element_fonts_enqueue($icon_type); $vc_pie_chart_value = '<i class="' . $iconClass . '"></i>'; } } $el_class = $this->getExtraClass($el_class); $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'vc_pie_chart wpb_content_element' . $el_class, $this->settings['base'], $atts); $css_class .= ' vc_pie_label-' . $label_type; $output = '<div class= "' . $css_class . '" data-pie-value="' . $value . '" data-pie-animate-label="' . $animate_label . '" data-pie-label-value="' . $label_value . '" data-pie-units="' . $units . '" data-pie-color="' . esc_attr($color) . '"' . ($width ? ' style="max-width:' . $width . '"' : '') . '>'; $output .= '<div class="wpb_wrapper">'; $output .= '<div class="vc_pie_wrapper">'; $output .= '<span class="vc_pie_chart_back"' . ($set_back_color ? ' style="border-color:' . $color . '"' : '') . '></span>'; $output .= '<span class="vc_pie_chart_value">' . $vc_pie_chart_value . '</span>'; $output .= '<canvas width="101" height="101"></canvas>'; $output .= '</div>'; if ($label_type != 'title') { $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_pie_chart_heading')); } $output .= '</div>' . $this->endBlockComment('.wpb_wrapper'); $output .= '</div>' . $this->endBlockComment('.wpb_pie_chart') . "\n"; echo $output; // no need to escape