function render($atts, $content = null, $base = '') { extract(shortcode_atts(array('url' => '', 'target' => '', 'size' => '', 'style' => 'ghost', 'skin' => '', 'el_class' => '', 'text' => '', 'el_id' => ''), $atts, 'dt_button_cta')); $result = ""; $content = $text == '' && $content != '' ? dt_remove_autop($content) : $text; $class = array('btn'); if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "button" . getCssID() . time() . rand(11, 99); } if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if (!empty($ico)) { $class[] = $ico; } if (!empty($size)) { $class[] = $size; } if (!empty($style)) { $class[] = "btn-" . $style; } if (!empty($skin)) { $class[] = "skin-" . $skin; } if (count($class)) { $result = '<a ' . ('' != $el_id ? "id=\"" . $el_id . "\" " : "") . (!empty($url) ? "href=\"" . $url . "\"" : "") . 'class="' . @implode(" ", $class) . '" target="' . $target . '">' . $content . '</a>'; } return $result; }
function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('facebook' => '', 'twitter' => '', 'gplus' => '', 'pinterest' => '', 'linkedin' => '', 'color' => '', 'shape' => 'circle', 'size' => 'medium', 'bg_color' => '', 'align' => 'center', 'el_class' => '', 'el_id' => '', 'spy' => 'none', 'scroll_delay' => 300), $atts, 'dt_social')); $class = array('dt-social', "shape-" . $shape, "size-" . $size, "align-" . $align); if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "social_" . getCssID(); } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ('' != $color) { $DEstyle[] = "#{$el_id} li a{color:" . $color . ";}"; } if ('' != $bg_color) { $DEstyle[] = "#{$el_id} li{background-color:" . $bg_color . ";}"; } $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $compile = "<ul id=\"" . $el_id . "\" class=\"" . @implode(" ", $class) . "\"" . $scollspy . ">" . ($facebook ? "<li><a href=\"" . $facebook . "\" target=\"_blank\"><i class=\"fontelloicon-facebook-1\"></i></a></li>" : "") . ($twitter ? "<li><a href=\"" . $twitter . "\" target=\"_blank\"><i class=\"fontelloicon-twitter-1\"></i></a></li>" : "") . ($gplus ? "<li><a href=\"" . $gplus . "\" target=\"_blank\"><i class=\"fontelloicon-gplus\"></i></a></li>" : "") . ($linkedin ? "<li><a href=\"" . $linkedin . "\" target=\"_blank\"><i class=\"fontelloicon-linkedin-1\"></i></a></li>" : "") . ($pinterest ? "<li><a href=\"" . $pinterest . "\" target=\"_blank\"><i class=\"fontelloicon-pinterest\"></i></a></li>" : "") . "</ul>"; return $compile; }
function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'scroll_delay' => '300', 'spy' => ''), $atts, 'dt_text')); $css_class = array('dt_text'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_text" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= do_shortcode($content); $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = "") { wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-chart', get_dt_plugin_dir_url() . "js/chart.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-chart'); extract(shortcode_atts(array('title' => '', 'el_id' => '', 'el_class' => ''), $atts)); global $DEstyle; if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('icon_type' => '', 'width' => '', 'title' => '', 'unit' => '', 'color' => '#1abc9c', 'bg' => '#ecf0f1', 'label' => '', 'icon_color' => '', 'iconbg' => '', 'value' => '10'), $atts, 'dt_progressbar_item')); $progress_bar = '<div class=\'progress_bar\'> <i class="' . $icon_type . '"></i> <div class="progress_info"> <h4 class=\'progress_title\'>' . $title . '</h4> <span class=\'progress_number\'><span>' . $value . '</span></span><span class="progres-unit">' . $unit . '</span> </div><div class=\'progress_content_outer\'> <div data-percentage=\'' . $value . '\' data-active="' . $color . '" data-nonactive="' . $bg . '" class=\'progress_content\'></div> </div></div>'; $css_class = array('progress_bars'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_progress" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $label) { $DEstyle[] = "#{$el_id} .progress_info * {color:" . $label . "}"; } if ("" != $icon_color) { $DEstyle[] = "#{$el_id} i:before,#{$el_id} i:after,#{$el_id} i {color:" . $icon_color . "}"; } if ("" != $iconbg) { $DEstyle[] = "#{$el_id} i {background-color:" . $iconbg . "}"; } $compile .= $progress_bar . "</div>"; return $compile; }
function render($atts, $content = null, $base = '') { $regexshortcodes = '\\[' . '(\\[?)' . "(dt_timeline_item|dt_timeline_sep)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'spy' => 'none', 'scroll_delay' => 300), $atts, 'dt_timeline')); global $DEstyle; if (!is_array($matches) || !count($matches)) { return ""; } $css_class = array('dt-timeline'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_timeline" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div class="liner">'; $spydly = 0; $scollspy = ""; foreach ($matches as $timelineitem) { $spydly = $spydly + (int) $scroll_delay; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } if ($timelineitem[2] == 'dt_timeline_item') { $param = shortcode_atts(array('title' => '', 'text' => '', 'icon_type' => '', 'position' => 'left'), shortcode_parse_atts($timelineitem[3]), 'dt_timeline_item'); $timelineitemcontent = '<div class="time-item ' . $param['position'] . '" ' . $scollspy . '>' . do_shortcode($timelineitem[0]) . '</div>'; } else { $timelineitemcontent = '<div class="time-separator" ' . $scollspy . '>' . do_shortcode($timelineitem[0]) . '</div>'; } $compile .= $timelineitemcontent; } $compile .= "</div></div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return "<!--- start timeline -->" . $compile . "<!--- end timeline -->"; }
function render($atts, $content = null, $base = '') { extract(shortcode_atts(array('border' => '', 'align' => '', 'image' => '', 'size' => 'full', 'url' => '', 'target' => '', 'el_id' => '', 'el_class' => '', 'image_style' => '', 'spy' => '', 'scroll_delay' => 300), $atts, 'dt_image')); global $DEstyle; $css_class = array('dt_image'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt_image" . getCssID(); } $image_id = $image; if (!($image = get_image_size($image, $size))) { return ""; } $image_alt_text = get_post_meta($image_id, '_wp_attachment_image_alt', true); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $link = $url != '' ? "<a href=\"" . esc_url($url) . "\" target=\"" . $target . "\">" : ""; $link_end = $url != '' ? "</a>" : ""; $compile .= "<div class=\"image-align-" . $align . "\">"; if ($image_style == 'diamond') { $compile .= "<div class=\"ketupat0\"" . ($image[1] ? " style=\"width:" . ($image[1] - $image[1] * 10 / 100) . "px;height:" . ($image[1] - $image[1] * 10 / 100) . "px\"" : "") . ">" . "<div class=\"ketupat1\" " . ('' != $border ? " style=\"border:{$border} solid\"" : "") . ">" . "<div class=\"ketupat2\">" . $link . "<img class=\"img-responsive " . ('' != $image_style ? "style-" . $image_style : "") . "\" src=\"" . esc_url($image[0]) . "\" alt=\"" . esc_attr($image_alt_text) . "\"/>" . $link_end . "</div></div></div>"; } else { $compile .= $link . "<img " . ('' != $border ? "style=\"border:{$border} solid\"" : "") . " class=\"img-responsive " . ('' != $image_style ? "style-" . $image_style : "") . "\" src=\"" . esc_url($image[0]) . "\" alt=\"" . esc_attr($image_alt_text) . "\"/>" . $link_end; } $compile .= "</div>"; $compile .= "</div>"; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = "") { wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-chart', get_dt_plugin_dir_url() . "js/chart.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-chart'); if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('unit' => '', 'title' => '', 'item_number' => '1', 'value' => '10', 'size' => '', 'color' => '#19bd9b', 'bg' => '', 'el_id' => '', 'el_class' => '', 'label_color' => '', 'unit_color' => ''), $atts, 'dt_circlebar_item')); global $DEstyle; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "circlebar" . getCssID(); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= '' != $el_class ? "class=\"" . $el_class . "\"" : ""; $compile .= ">"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $label_color) { $DEstyle[] = "#{$el_id} .pie-title {color:" . $label_color . "}"; } if ("" != $unit_color) { $DEstyle[] = "#{$el_id} .tocounter,#{$el_id} .tocounter-unit {color:" . $unit_color . "}"; } $compile .= '<div class="dt_circlebar"> <div class=\'pie_chart_holder normal\'> <canvas class="doughnutChart" data-noactive="' . $bg . '" data-size="' . $size . '" data-unit="' . $unit . '" data-active="' . $color . '" data-percent=\'' . $value . '\'></canvas> </div> <h4 class="pie-title">' . $title . '</h4> <div class="pie-description"></div> </div></div>'; return $compile; }
function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('column' => 12, 'title' => '', 'el_id' => '', 'el_class' => '', 'image' => '', 'background_style' => '', 'bg_color' => '', 'font_color' => '', 'p_top' => '', 'p_bottom' => '', 'p_left' => '', 'p_right' => ''), $atts, 'dt_column')); $css_class = array('dt_column'); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id) { $el_id = "dt_column_" . getCssID(); } $css_style = getCssMargin($atts, true); if ('' != $bg_color) { $css_style['background-color'] = "background-color:{$bg_color}"; } if ('' != $image && ($background_image = wp_get_attachment_image_src($image, 'full'))) { $css_style['background-image'] = "background-image:url(" . $background_image[0] . ")!important;"; switch ($background_style) { case 'cover': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important; background-size: cover!important"; break; case 'no-repeat': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important;background-size:auto !important"; break; case 'repeat': $css_style['background-position'] = "background-position: 0 0 !important;background-repeat: repeat !important;background-size:auto !important"; break; case 'contain': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important;background-size: contain!important"; break; case 'fixed': $css_style['background-position'] = "background-position: center !important; background-repeat: no-repeat !important; background-size: cover!important;background-attachment: fixed !important"; break; } } $css_column = in_array($column, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) ? "col-sm-" . min($column, 12) : "column_custom_" . $column; array_push($css_class, $css_column); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= do_shortcode($content); $compile .= "</div>"; if ('' != $font_color) { $DEstyle[] = "#{$el_id} * {color:{$font_color}}"; } if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . @implode(";", $css_style) . "}"; } return $compile; }
function render($atts, $content = null, $base = "") { global $DEstyle; extract(shortcode_atts(array('year' => '', 'month' => '', 'date' => '', 'time' => date('H:s', current_time('timestamp', 0)), 'url' => '', 'countdown_box_color' => '', 'countdown_text_color' => '', 'countdown_label_color' => '', 'dot_color' => '', 'el_id' => '', 'countdown_box_size' => '', 'el_class' => ''), $atts, 'dt_countdown')); if (!stripos($time, ":")) { $time .= ":00"; } $message = str_replace(array("\n", "\t"), array("", ""), do_shortcode($content)); $current_offset = get_option('gmt_offset'); $dateTo = "{$month} {$date} {$year} {$time}"; $timeCurrent = !empty($current_offset) ? time() + $current_offset * 3600 : time(); $timeTo = strtotime($dateTo); $css_class = array('dt-countdown'); if ('' != $el_class) { array_push($css_class, $el_class); } if ($countdown_box_size == 'small' || $countdown_box_size == 'medium') { array_push($css_class, 'dt-countdown-' . $countdown_box_size); } if ('' == $el_id) { $el_id = "dt_ct" . getCssID() . time() . rand(11, 99); } $css_style = getCssMargin($atts); $compile = ""; if ($timeCurrent > $timeTo) { if (!empty($url)) { $compile .= '<meta http-equiv="refresh" content="5;URL=' . $url . '" />'; } $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div id="countdown_' . $el_id . '" class="countdown">' . esc_js($message) . '</div></div>'; } else { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_register_style('jquery.countdown', get_dt_plugin_dir_url() . "css/jquery.countdown.css", array(), false); wp_enqueue_style('jquery.countdown'); wp_register_script('jquery.plugin', get_dt_plugin_dir_url() . "js/jquery.plugin" . $suffix . ".js", array('jquery')); wp_enqueue_script('jquery.plugin'); wp_register_script('jquery.countdown', get_dt_plugin_dir_url() . "js/jquery.countdown" . $suffix . ".js", array('jquery.plugin')); wp_enqueue_script('jquery.countdown'); $until = $timeTo - $timeCurrent; $compile .= "<script type=\"text/javascript\">" . 'jQuery(document).ready(function($) {' . '\'use strict\';' . '$(\'#countdown_' . $el_id . '\').countdown({until: +' . $until . (!empty($message) && empty($url) ? ",expiryText:'" . esc_js($message) . "'" : "") . (!empty($url) ? ",expiryUrl:'" . esc_url($url) . "'" : "") . '}); ' . '});</script>'; $compile .= "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<div id="countdown_' . $el_id . '" class="countdown"></div></div>'; if (!empty($countdown_box_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-amount{border-color: ' . $countdown_box_color . ';}'; } if (!empty($countdown_text_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-amount{color: ' . $countdown_text_color . ';}'; } if (!empty($countdown_label_color)) { $DEstyle[] = '#countdown_' . $el_id . ' .countdown-period{color: ' . $countdown_label_color . ';}'; } } if (count($css_style)) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function krypton_post_carousel_shortcode($output, $content = "", $atts = array()) { extract(shortcode_atts(array('number_of_posts' => 12, 'category' => 0, 'sorting_type' => 'new', 'show_text' => 'no', 'col' => 3, 'speed' => 400, 'type' => 0, 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'post_carousel')); global $DEstyle, $krypton_Scripts, $dt_revealData; $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "featured" . getCssID(); } $css_class = array(); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $widgetID = "carousel" . preg_replace('/[\\-]/', '', $el_id); switch ($sorting_type) { case "new": $sort_type = "post_date"; break; case "random": $sort_type = "rand"; break; } $args = array('posts_per_page' => $number_of_posts, 'post_type' => 'post', 'post_status' => 'publish', 'cat' => $category, 'featured' => true, 'meta_key' => '_thumbnail_id', 'orderby' => $sort_type, 'order' => 'DESC'); $query = new WP_Query(); $query->query($args); if ($query->have_posts()) { wp_register_script('owl.carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '', false); wp_enqueue_script('owl.carousel'); if ($type == 2) { if ($col > 2) { ?> <style> @media (min-width: 1024px) and (max-width: 1200px) { #<?php print $widgetID; ?> .owl-slide { max-width: 300px; margin: 40px 20px; } } </style> <?php } $compile .= '<div id="' . $widgetID . '" class="dt-featured-posts owl-carousel">'; $thumbSize = 1200 / $col; if ($query->have_posts()) { $i = 0; $spydly = 0; while ($query->have_posts()) { $query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'single-post-thumbnail'); $featured_image_url = aq_resize($featured_image[0], $thumbSize, $thumbSize, true, true, true); $alt_image = get_post_meta(get_post_thumbnail_id(get_the_ID()), '_wp_attachment_image_alt', true); $post = get_post(); $post_excerpt = strlen($post->post_excerpt) > 0 ? smarty_modifier_truncate($post->post_excerpt, 100, "") : smarty_modifier_truncate(get_the_content(), 100, ""); if (strlen($featured_image[0]) > 0) { $full_image_url = $featured_image[0]; $excerpt = $post_excerpt ? '<div class="md-description"><p>' . $post_excerpt . '</p></div>' : ""; $modalContent = '<div id="' . $widgetID . '-' . get_the_ID() . '" class="popup-gallery md-modal md-effect-15"> <div class="md-content"> <img src="' . esc_url($featured_image[0]) . '" class="img-responsive" alt="' . esc_attr($alt_image) . '"/> ' . $excerpt . ' <button class="button md-close right btn-cross"><i class="icon-cancel"></i></button> </div></div>'; array_push($dt_revealData, $modalContent); } else { $modalContent = ''; } $scollspy = ""; if ('none' !== $spy && !empty($spy) && $i < $col) { $spydly = $spydly + (int) $scroll_delay; $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="owl-slide col-sd-12" ' . $scollspy . '> <div class="top-image"> <img src="' . esc_url($featured_image_url) . '" alt="' . esc_attr($alt_image) . '"/> </div> <div class="description"> <div class="slide-content"> <h4>' . get_the_title() . '</h4> </div> <div class="nav-slide"><a href="' . get_permalink() . '" class="btn icon-link"></a><a onClick="return false;" data-modal="' . $widgetID . '-' . get_the_ID() . '" class="md-trigger btn icon-zoom-in"></a></div> </div> </div>'; $i++; } } wp_reset_postdata(); $compile .= '</div><div class="owl-carousel-navigation"> <a class="btn btn-owl prev"></a> <a class="btn btn-owl next"></a></div>'; $script = 'jQuery(document).ready(function($) { \'use strict\'; var ' . $widgetID . ' = $("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : ' . $col . ', //10 items above 1000px browser width itemsDesktop : [1200,3], //5 items between 1000px and 901px itemsDesktopSmall : [1023,2], // 3 items betweem 900px and 601px itemsTablet : [768,2], //2 items between 600 and 0; itemsMobile : [600,1], // itemsMobile disabled - inherit from itemsTablet option pagination : false, slideSpeed : ' . $speed . ' }); ' . $widgetID . '.parent().find(".next").click(function(){ ' . $widgetID . '.trigger(\'owl.next\'); }); ' . $widgetID . '.parent().find(".prev").click(function(){ ' . $widgetID . '.trigger(\'owl.prev\'); }); ' . $widgetID . '.owlCarousel(\'reload\'); $(".owl-slide",' . $widgetID . ') .each(function(){ this.slide = $(this).find(\'.top-image img\'); this.slide.height($(this).width()); $(this).height($(this).width()); this.desc = $(this).find(\'.description\').height(this.slide.height()); }) .hover(function(){ this.desc.animate({\'margin-top\':-this.slide.height()}); },function(){ this.desc.animate({\'margin-top\':\'0px\'}); }); } catch(err){} });'; array_push($krypton_Scripts, $script); } else { $compile .= '<div id="' . $widgetID . '" class="dt-blog-posts owl-carousel">'; $thumbSize = 1200 / $col; if ($query->have_posts()) { $i = 0; $spydly = 0; while ($query->have_posts()) { $query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'single-post-thumbnail'); $featured_image_url = aq_resize($featured_image[0], $thumbSize, $thumbSize, true, true, true); $alt_image = get_post_meta(get_post_thumbnail_id(get_the_ID()), '_wp_attachment_image_alt', true); $post = get_post(); $miniatura = get_post_meta(get_the_ID(), 'imagen_miniatura', true); $post_excerpt = strlen($post->post_excerpt) > 0 ? smarty_modifier_truncate($post->post_excerpt, 100, "") : smarty_modifier_truncate(get_the_content(), 100, ""); $avatar_url = get_avatar_url(get_the_author_meta('ID'), array('size' => 85)); $idpost = get_the_id(); $category_detail = get_the_category($idpost); $idcat = $category_detail[0]->cat_ID; $icocat = json_decode($category_detail[0]->term_thumbnail); $scollspy = ""; if ('none' !== $spy && !empty($spy) && $i < $col) { $spydly = $spydly + (int) $scroll_delay; $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $countview = 0; $countview = get_post_meta(get_the_ID(), 'post_views_count', true); if ($countview == '') { delete_post_meta(get_the_ID(), 'post_views_count'); add_post_meta(get_the_ID(), 'post_views_count', '0'); } // echo 'nom'; // print_r($category_detail[0]->slug); // print_r($category_detail[0]->cat_ID); $compile .= ' <div class="col-sd-12" ' . $scollspy . '> <div class="owl-slide"> <figure> <div class="top-image vd"> <img src="' . esc_url($featured_image_url) . '" alt="' . esc_attr($alt_image) . '"/> </div> <div class="thumb-image"> <img src="' . $icocat->url . '"/> </div> <figcaption> <div class="description"> <a href="' . get_permalink() . '" class="post-title">' . strtoupper(get_the_title()) . '</a> ' . $post_excerpt . ' </div> </figcaption> </figure> <div class="mini-panel cat-' . $category_detail[0]->slug . '"> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-clock-8"></i>' . get_the_date('d M') . '</div> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-chat-inv"></i>' . get_comments_number(get_the_ID()) . '</div> <div class="col-sm-4 col-md-4 col-xs-4"><i class="icon-eye-5"></i>' . $countview . '</div> </div> </div> </div>'; $i++; } } wp_reset_postdata(); $compile .= '</div><div class="owl-carousel-navigation"> <a class="btn btn-owl prev"></a> <a class="btn btn-owl next"></a></div>'; $script = 'jQuery(document).ready(function($) { \'use strict\'; var ' . $widgetID . ' = $("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : ' . $col . ', itemsDesktop : [1200,3], itemsDesktopSmall : [1023,2], itemsTablet : [768,2], itemsMobile : [600,1], pagination : false, slideSpeed : ' . $speed . '}); ' . $widgetID . '.parent().find(".next").click(function(){ ' . $widgetID . '.trigger(\'owl.next\'); }); ' . $widgetID . '.parent().find(".prev").click(function(){ ' . $widgetID . '.trigger(\'owl.prev\'); }); ' . $widgetID . '.owlCarousel(\'reload\'); } catch(err){} });'; array_push($krypton_Scripts, $script); } } $compile .= '</div>'; if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = "") { extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'value' => '', 'footer_text' => '', 'layout' => '', 'button' => 'button1', 'button_text' => __('Submit', 'detheme_builder'), 'button_text_color' => '', 'button_color' => '', 'font_size' => '', 'vertical_padding' => '', 'horizontal_padding' => '', 'button_radius' => '', 'email_label' => __('Email Label', 'detheme_builder'), 'name_label' => __('Your name', 'detheme_builder'), 'button_font' => '', 'expanded' => 0, 'button_align' => 'left', 'label_align' => 'left', 'input_radius' => '', 'input_vertical_padding' => '', 'input_horizontal_padding' => '', 'element_margin' => '', 'gradient' => false, 'gradient_color_to' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_optin_form')); wp_register_script('optin', get_dt_plugin_dir_url() . 'js/optin_form.js', array('jquery'), '', false); wp_enqueue_script('optin'); global $DEstyle; $code = ""; $compile = ""; $excss = getCssID("optin_form_"); $buttoncss = $buttonHovercss = $inputcss = array(); if (!empty($button_text_color)) { $buttoncss[] = "color:" . $button_text_color; } if (!empty($button_color)) { if ($gradient && !empty($gradient_color_to)) { $buttoncss[] = "background:-webkit-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-moz-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-ms-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:-o-linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; $buttoncss[] = "background:linear-gradient(" . $button_color . "," . $gradient_color_to . ")"; } else { $buttoncss[] = "background-color:" . $button_color; } $buttonHovercss[] = "background-color:" . darken($button_color, 5); } if (!empty($font_size)) { $buttoncss[] = "font-size:" . $font_size . "px"; } if (!empty($horizontal_padding)) { $buttoncss[] = "padding-left:" . $horizontal_padding . "px"; $buttoncss[] = "padding-right:" . $horizontal_padding . "px"; } if (!empty($vertical_padding)) { $buttoncss[] = "height:" . $vertical_padding . "px"; $inputcss[] = "height:" . $vertical_padding . "px"; } if ($expanded) { $buttoncss[] = "width:100%"; } if (!empty($button_radius)) { $buttoncss[] = "border-radius:" . $button_radius . "px"; } if (!empty($button_font)) { $font = 'http://fonts.googleapis.com/css?family=Droid+Sans%7COpen+Sans%7CTangerine%7CJosefin+Slab%7CArvo%7CLato%7CVollkorn%7CAbril+Fatface%7CUbuntu%7CPT+Sans%7CPT+Serif%7COld+Standard+TT'; wp_enqueue_style('google-font', $font); $buttoncss[] = "font-family:" . $button_font; } if (!empty($element_margin)) { $element_margin = preg_match('/horizontal/', $layout) ? "padding-right:" . $element_margin . "px !important" : "margin-bottom:" . $element_margin . "px !important"; } if (!empty($input_horizontal_padding)) { $inputcss[] = "padding-left:" . $input_horizontal_padding . "px"; $inputcss[] = "padding-right:" . $input_horizontal_padding . "px"; } if (!empty($label_align)) { $inputcss[] = "text-align:" . $label_align; } if (!empty($input_radius)) { $inputcss[] = "border-radius:" . $input_radius . "px"; } $formcode = '<form role="form" class="' . $layout . (preg_match('/horizontal/', $layout) ? " form-inline" : "") . '" id="dt_optin_form_' . $excss . '">'; $formcode .= $layout == 'vertical_email' || $layout == 'horizontal_email' ? "" : "<div class=\"form-group field-wrap\">"; $formcode .= '<input type="' . ($layout == 'vertical_email' || $layout == 'horizontal_email' ? "hidden" : "text") . '" class="dt_name form-control" name="dt_name" placeholder="' . $name_label . '" />'; $formcode .= $layout == 'vertical_email' || $layout == 'horizontal_email' ? "" : "</div>"; $formcode .= '<div class="form-group field-wrap"><input type="text" class="dt_email form-control" name="dt_email" placeholder="' . $email_label . '" /></div>'; $formcode .= '<div class="form-group button-wrap" style="text-align:' . $button_align . '"><button class="form_connector_submit" type="submit" value="' . $button_text . '" >' . $button_text . '</button></div>'; $formcode .= '</form>'; if (count($inputcss)) { $DEstyle[] = "." . $excss . " input,." . $excss . " input.dt_name,." . $excss . " input.dt_email{" . @implode(";", $inputcss) . "}"; } if (count($buttonHovercss)) { $DEstyle[] = "." . $excss . " .form_connector_submit:hover{" . @implode(";", $buttonHovercss) . "}"; } if (!empty($element_margin)) { $DEstyle[] = "." . $excss . " .field-wrap{" . $element_margin . "}"; } $DEstyle[] = "." . $excss . " .form_connector_submit{" . @implode(";", $buttoncss) . "}"; $css_class = array('optin-form', $excss, $button); $css_style = getCssMargin($atts); if ('' != $el_class) { array_push($css_class, $el_class); } if ('' == $el_id && "" != $css_style) { $el_id = "optin_wrapper" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; if (!empty($title)) { $compile .= '<h2 class="optin-heading">' . $title . '</h2>'; } if (!empty($sub_title)) { $compile .= '<div class="optin-subheading">' . $sub_title . '</div>'; } $compile .= '<div class="optin-content">' . $formcode . '</div>'; if (!empty($footer_text)) { $compile .= '<div class="optin-footer">' . $footer_text . '</div>'; } $compile .= '<div class="optin_code" >' . html_entity_decode($content) . '</div>'; $compile .= "</div>"; $compile .= '<script type="text/javascript">var ajaxurl = \'' . admin_url('admin-ajax.php') . '\';</script>'; return $compile; }
function render($atts, $content = null, $base = "") { global $DEstyle; wp_register_script('jquery.appear', get_dt_plugin_dir_url() . "js/jquery.appear.js", array()); wp_register_script('jquery.counto', get_dt_plugin_dir_url() . "js/jquery.counto.js", array()); wp_register_script('dt-iconbox', get_dt_plugin_dir_url() . "js/dt_iconbox.js", array('jquery.appear', 'jquery.counto')); wp_enqueue_script('dt-iconbox'); if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'iconbox_heading' => '', 'color_heading' => '', 'button_link' => '', 'button_text' => '', 'icon_type' => '', 'layout_type' => '1', 'target' => '_blank', 'iconbox_text' => '', 'link' => '', 'iconbox_number' => 100, 'spy' => 'none', 'icon_size' => '', 'icon_color' => '', 'iconbg' => '', 'scroll_delay' => 300), $atts, 'dt_iconbox')); $content = empty($content) && !empty($iconbox_text) ? $iconbox_text : $content; $iconbox_number = (int) $iconbox_number; $color_heading = !empty($color_heading) ? " style=\"color:" . $color_heading . "\"" : ""; $scollspy = ""; if ('' == $el_id) { $el_id = "module_dt_iconboxes_" . getCssID(); } $css_class = array('module_dt_iconboxes'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}"'; } switch ($layout_type) { case '2': $output = '<div class="dt-iconboxes-2 layout-' . $layout_type . '" ' . $scollspy . '> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5a">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div> </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-2 i {color:" . $icon_color . ";}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-2:hover i {background-color:" . $iconbg . "!important;color: #ffffff;}"; } break; case '3': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> <span class="boxes">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</span> <h3 class="dt-counter">' . $iconbox_number . '</h3> <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text"> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes,#{$el_id} .dt-iconboxes h3 {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-3 span:hover {background-color:" . $iconbg . "!important;color:#fff!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-3 span:hover:after,#{$el_id} .dt-iconboxes.layout-3 span:hover:before{border-top-color:" . $iconbg . "!important;}"; } break; case '4': $output = '<div ' . $scollspy . '><div class="dt-iconboxes-4 layout-' . $layout_type . '"> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5d">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div>' . ' </div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-4 i {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-4,#{$el_id} .dt-iconboxes-4:hover .dt-section-icon {background-color:" . $iconbg . "!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes-4:hover {background-color: " . darken($iconbg, 20) . "!important;}"; $DEstyle[] = "#{$el_id} .dt-iconboxes-4:hover .dt-section-icon:after,#{$el_id} .dt-iconboxes-4:hover .dt-section-icon:before {border-top-color: " . $iconbg . "!important;}"; } break; case '5': $output = '<div class="dt-iconboxes-5 layout-' . $layout_type . '" ' . $scollspy . '> <div class="dt-section-icon hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5a">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="hi-icon ' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</div> <h4' . $color_heading . '>' . $iconbox_heading . '</h4>' . '<div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div>' . ' </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes-5 .dt-section-icon {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = ".no-touch #{$el_id} .dt-iconboxes-5:hover .hi-icon-effect-5 .hi-icon {background-color:" . $iconbg . "!important;border-color:" . $iconbg . "!important;}"; } break; case '6': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> ' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . ' <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text"> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes i {color:" . $icon_color . "!important;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes.layout-6:hover {background-color:" . $iconbg . "!important;}"; } break; case '7': case '8': $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> ' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . ' <div class="text-box"><h4' . $color_heading . '>' . $iconbox_heading . '</h4> ' . (!empty($content) ? do_shortcode($content) : "") . '</div></div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes i {color:" . $icon_color . "!important;}"; } break; default: $output = '<div class="dt-iconboxes layout-' . $layout_type . '" ' . $scollspy . '> <span class="boxes">' . (strlen($link) > 0 ? "<a target='" . $target . "' href='" . $link . "'>" : "") . '<i class="' . $icon_type . '"></i>' . (strlen($link) > 0 ? "</a>" : "") . '</span> <h4' . $color_heading . '>' . $iconbox_heading . '</h4><div class="dt-iconboxes-text">' . (!empty($content) ? do_shortcode($content) : "") . '</div> </div>'; if ($icon_color != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes {color:" . $icon_color . ";}"; $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover {color:#ffffff;}"; } if ($iconbg != '') { $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover {background-color:" . $iconbg . "!important;border-color: " . $iconbg . ";}"; $DEstyle[] = "#{$el_id} .dt-iconboxes span.boxes:hover:after,#{$el_id} .dt-iconboxes span.boxes:hover:before{border-top: 11px solid " . $iconbg . "!important;}"; } break; } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= $output . "</div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ($icon_size != '') { $DEstyle[] = "#{$el_id} i {font-size:" . $icon_size . "px;}"; } return $compile; }
function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('separator' => '5', 'separatorcolor' => 'none', 'backgroundcolor' => 'none', 'el_id' => '', 'el_class' => ''), $atts, 'dt_section_separator')); if ($backgroundcolor != '' and $backgroundcolor != 'none') { $backgroundcolor = "#" . preg_replace('/#/', '', $backgroundcolor); } if ($separatorcolor != '' and $separatorcolor != 'none') { $separatorcolor = '#' . preg_replace('/#/', '', $separatorcolor); } $css_class = array('section-separator'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "separator-" . getCssID(); } $compile = "<section "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= 'class="' . @implode(" ", $css_class) . '"'; switch ($separator) { case 1: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="smallTriangleColorUp2"> <path d="M46 101 L50 25 L54 101 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 2: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="smallTriangleColorDown2"> <path d="M46 -1 L50 75 L54 -1 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 3: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px; position: relative; text-align: center;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="50" fill="' . $separatorcolor . '" /> </svg> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0;"> <path d="M0 50 L100 50 L100 100 L0 100 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 4: $compile .= ' style="background:' . $backgroundcolor . '; height: 100px; position: relative; text-align: center;"> <svg preserveAspectRatio="none" viewBox="0 1 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: -50%; left: 0;"> <path d="M0 50 L100 50 L100 100 L0 100 Z" fill="' . $separatorcolor . '" /> </svg> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="50" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 5: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="bigTriangleDown"> <path d="M0 -1 L50 99 L100 -1 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; case 6: $compile .= ' style="background-color:' . $backgroundcolor . '; height: 100px;"> <svg preserveAspectRatio="none" viewBox="0 0 100 100" height="100" width="100%" version="1.1" xmlns="http://www.w3.org/2000/svg" id="bigTriangleUp"> <path d="M0 101 L50 1 L100 101 Z" fill="' . $separatorcolor . '" /> </svg> </section>'; break; default: $compile = ''; break; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = '') { $regexshortcodes = '\\[' . '(\\[?)' . "(dt_partner_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } extract(shortcode_atts(array('spy' => 'none', 'scroll_delay' => 300, 'column' => '4', 'el_class' => '', 'el_id' => ''), $atts, 'dt_partner')); if (!is_array($matches) || !count($matches)) { return ""; } $css_class = array('dt-partner'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_tab_wrapper" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $spydly = 0; $scollspy = ""; $class = 'partner-item '; switch ($column) { case 2: $class .= 'col-md-6 col-sm-6 col-xs-6'; break; case 3: $class .= 'col-md-4 col-sm-6 col-xs-6'; break; case 4: $class .= 'col-lg-3 col-md-4 col-sm-6 col-xs-6'; break; case 6: $class .= 'col-lg-2 col-md-3 col-sm-6 col-xs-6'; break; case 1: default: $class .= 'col-sm-12'; break; } foreach ($matches as $partneritem) { $spydly = $spydly + (int) $scroll_delay; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="border-right ' . $class . '" ' . $scollspy . '>' . do_shortcode($partneritem[0]) . '</div>'; } if (count($matches) % $column) { $compile .= str_repeat("<div class=\"dummy " . $class . "\"></div>", $column - count($matches) % $column); } $compile .= "</div>"; return "<!--- start partner -->" . $compile . "<!--- end partner -->"; }
function render($atts, $content = null, $base = "") { extract(shortcode_atts(array('portfolio_cat' => '', 'portfolio_num' => 10, 'speed' => 800, 'autoplay' => '0', 'spy' => 'none', 'scroll_delay' => 300, 'layout' => 1, 'el_id' => '', 'el_class' => '', 'scroll_page' => '', 'interval' => 1000), $atts, 'dt_portfolio')); $queryargs = array('post_type' => 'port', 'no_found_rows' => false, 'meta_key' => '_thumbnail_id', 'posts_per_page' => $portfolio_num, 'compile' => '', 'script' => ''); if (!empty($portfolio_cat)) { $queryargs['tax_query'] = array(array('taxonomy' => 'portcat', 'field' => 'id', 'terms' => $portfolio_cat)); } $query = new WP_Query($queryargs); $compile = ""; if ($query->have_posts()) { $spydly = 0; $portspty = 0; wp_enqueue_style('owl.carousel'); wp_enqueue_script('owl.carousel'); $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_portfolio-" . getCssID() . time() . rand(11, 99); } $widgetID = sanitize_key($el_id . "_carousel"); $modal_effect = apply_filters('dt_portfolio_modal_effect', 'md-effect-15'); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= 'class="dt-portfolio-container portfolio-type-' . ($layout == '2' ? "text" : "image") . '"> <div class="owl-carousel-navigation prev-button"> <a class="btn btn-owl prev btn-color-secondary skin-dark">' . __('<i class="icon-left-open-big"></i>', 'detheme_builder') . '</a> </div> <div class="owl-carousel" id="' . $widgetID . '">'; while ($query->have_posts()) { $query->the_post(); $terms = get_the_terms(get_the_ID(), 'portcat'); $term_lists = array(); if (!empty($terms)) { foreach ($terms as $term) { $cssitem[] = sanitize_html_class($term->slug, $term->term_id); $term_lists[] = "<a href=\"" . get_term_link($term) . "\">" . $term->name . "</a>"; } } $imageId = get_post_thumbnail_id(get_the_ID()); $featured_image = get_post($imageId); if (isset($featured_image->guid)) { $imgurl = aq_resize($featured_image->guid, 0, 300, true); $spydly = $spydly + (int) $scroll_delay; $scollspy = ""; if ('none' !== $spy && !empty($spy) && $portspty < 5) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="portfolio-item" ' . $scollspy . '>'; if ('1' == $layout) { $compile .= '<div class="post-image-container">' . (isset($imgurl) && !empty($imgurl) ? '<div class="post-image"> <img src="' . esc_url($imgurl) . '" alt="' . get_the_title() . '" /></div>' : '') . ' <div class="imgcontrol tertier_color_bg_transparent"> <div class="portfolio-termlist">' . (count($term_lists) ? @implode(', ', $term_lists) : "") . '</div> <div class="portfolio-title">' . get_the_title() . '</div> <div class="imgbuttons"> <a class="btn icon-link secondary_color_button " href="' . get_the_permalink() . '"></a> </div> </div> </div>'; } else { $compile .= '<div class="post-image-container">' . (isset($imgurl) && !empty($imgurl) ? '<div class="post-image"> <img src="' . esc_url($imgurl) . '" alt="' . get_the_title() . '" /></div>' : '') . ' <div class="imgcontrol tertier_color_bg_transparent"> <div class="imgbuttons"> <a class="btn icon-link secondary_color_button " href="' . get_the_permalink() . '"></a> </div> </div> </div>'; $compile .= '<div class="portfolio-description">'; $compile .= '<div class="portfolio-termlist">' . (count($term_lists) ? @implode(', ', $term_lists) : "") . '</div>'; $compile .= '<div class="portfolio-title">' . get_the_title() . '</div>'; $compile .= '<div class="portfolio-excerpt"><p>' . get_the_excerpt() . '</p>'; $compile .= '<a href="' . get_the_permalink() . '" class="read_more" title="' . esc_attr(sprintf(__('Detail to %s', 'detheme_builder'), the_title_attribute(array('echo' => false)))) . '">' . __('Read more', 'detheme_builder') . '<i class="icon-right-dir"></i></a>'; $compile .= '</div></div>'; } $compile .= '</div>'; $portspty++; } } $compile .= "</div>\r\n <div class=\"owl-carousel-navigation next-button\">\r\n <a class=\"btn btn-owl next btn-color-secondary skin-dark\">" . __('<i class="icon-right-open-big"></i>', 'detheme_builder') . "</a>\r\n </div></div>"; $script = '<script type="text/javascript">' . "\n" . 'jQuery(document).ready(function($) { \'use strict\';' . "\n" . ' var ' . $widgetID . ' = jQuery("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : 5, pagination : false,' . ($autoplay ? 'autoPlay:' . ($speed + $interval) . ',' : '') . "\r\n slideSpeed : " . $speed . ",paginationSpeed : " . $speed . ",rewindSpeed : " . $speed . ","; if ($scroll_page == '1') { $script .= "scrollPerPage : true,"; } $script .= '});' . "\n" . ' ' . $widgetID . '.closest(\'.dt-portfolio-container\').find(".next").click(function(){ ' . $widgetID . '.trigger(\'owl.next\'); }); ' . $widgetID . '.closest(\'.dt-portfolio-container\').find(".prev").click(function(){ ' . $widgetID . '.trigger(\'owl.prev\'); });'; $script .= '} catch(err){} });</script>'; $compile .= $script; if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } } wp_reset_query(); return $compile; }
function render($atts, $content = null, $base = '') { $regexshortcodes = '\\[' . '(\\[?)' . "(dt_pricetable_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } global $DEstyle; extract(shortcode_atts(array('title' => '', 'table_column' => '3', 'body_back_color' => '', 'header_back_color' => '', 'evencell_back_color' => '', 'oddcell_back_color' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_pricetable')); wp_enqueue_style('detheme-builder'); $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "pricing-table-" . getCssID() . time() . rand(11, 99); } $content = preg_replace('/\\[dt_pricetable_item/', '[dt_pricetable_item price_colum="' . $table_column . '" body_back_color="' . $body_back_color . '" header_back_color="' . $header_back_color . '" evencell_back_color="' . $evencell_back_color . '" oddcell_back_color="' . $oddcell_back_color . '"', $content); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= ("" != $el_class ? "class=\"" . $el_class . "\"" : "") . ">"; $compile .= '<div class="dt-pricing-table ' . $table_column . '-column" data-column="' . $table_column . '">' . do_shortcode($content) . '</div>'; $compile .= "</div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = "") { extract(shortcode_atts(array('lat' => -7.2852292, 'lang' => 112.6809869, 'zoom' => 7, 'zoomcontrol' => true, 'pancontrol' => true, 'streetcontrol' => true, 'scrollcontrol' => true, 'height' => '400px', 'width' => '', 'style' => 'pastel', 'marker' => 'default', 'image_marker' => '', 'title' => '', 'el_id' => '', 'el_class' => ''), $atts, 'dt_map')); $height = abs((int) $height) . "px"; $dt_el_id = getCssID(); wp_enqueue_script('gmap', "https://maps.googleapis.com/maps/api/js?v=3.exp", array('jquery')); $mapStyle = array('shades' => '[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":17}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":29},{"weight":0.2}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":18}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":16}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":21}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#000000"},{"lightness":16}]},{"elementType":"labels.text.fill","stylers":[{"saturation":36},{"color":"#000000"},{"lightness":40}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#000000"},{"lightness":19}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"},{"lightness":20}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#000000"},{"lightness":17},{"weight":1.2}]}]', 'midnight' => '[{"featureType":"water","stylers":[{"color":"#021019"}]},{"featureType":"landscape","stylers":[{"color":"#08304b"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#0c4152"},{"lightness":5}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#0b434f"},{"lightness":25}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#0b3d51"},{"lightness":16}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#000000"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#000000"},{"lightness":13}]},{"featureType":"transit","stylers":[{"color":"#146474"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#000000"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"color":"#144b53"},{"lightness":14},{"weight":1.4}]}]', 'bluewater' => '[{"featureType":"water","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"landscape","stylers":[{"color":"#f2f2f2"}]},{"featureType":"road","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]}]', 'lightmonochrome' => '[{"featureType":"water","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":-78},{"lightness":67},{"visibility":"simplified"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":10},{"lightness":69},{"visibility":"on"}]},{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]}]', 'neutralblue' => '[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#193341"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#2c5a71"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#29768a"},{"lightness":-37}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"featureType":"transit","elementType":"geometry","stylers":[{"color":"#406d80"}]},{"elementType":"labels.text.stroke","stylers":[{"visibility":"on"},{"color":"#3e606f"},{"weight":2},{"gamma":0.84}]},{"elementType":"labels.text.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"weight":0.6},{"color":"#1a3541"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#2c5a71"}]}]', 'avocadoworld' => '[{"featureType":"water","elementType":"geometry","stylers":[{"visibility":"on"},{"color":"#aee2e0"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#abce83"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#769E72"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#7B8758"}]},{"featureType":"poi","elementType":"labels.text.stroke","stylers":[{"color":"#EBF4A4"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"visibility":"simplified"},{"color":"#8dab68"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#5B5B3F"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ABCE83"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"color":"#A4C67D"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#9BBF72"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#EBF4A4"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"geometry.stroke","stylers":[{"visibility":"on"},{"color":"#87ae79"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#7f2200"},{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"},{"visibility":"on"},{"weight":4.1}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#495421"}]},{"featureType":"administrative.neighborhood","elementType":"labels","stylers":[{"visibility":"off"}]}]', 'nature' => '[{"featureType":"landscape","stylers":[{"hue":"#FFA800"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#53FF00"},{"saturation":-73},{"lightness":40},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FBFF00"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#00FFFD"},{"saturation":0},{"lightness":30},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00BFFF"},{"saturation":6},{"lightness":8},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#679714"},{"saturation":33.4},{"lightness":-25.4},{"gamma":1}]}]', 'pastel' => '[{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":60}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"lightness":30}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ef8c25"},{"lightness":40}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#b6c54c"},{"lightness":40},{"saturation":-40}]},{}]'); $mapOptions = array(); $mapOptions['zoom'] = 'zoom: ' . $zoom; $markerOption = ""; if ($marker !== 'default') { $image_url = get_dt_plugin_dir_url() . 'images/map_marker.png'; if ($image_marker) { $imageMarker = wp_get_attachment_image_src(trim($image_marker), 'full', false); if (!empty($imageMarker[0])) { $image_url = $imageMarker[0]; } } $markerOption = 'var iconMarker = {url: \'' . $image_url . '\'};'; } if (!$zoomcontrol) { $mapOptions['zoomControl'] = 'zoomControl:false'; } if (!$pancontrol) { $mapOptions['panControl'] = 'panControl:false'; } if (!$streetcontrol) { $mapOptions['streetViewControl'] = 'streetViewControl:false'; } if (!$scrollcontrol) { $mapOptions['scrollwheel'] = 'scrollwheel:false'; } $mapscript = "<div id=\"map-canvas" . $dt_el_id . "\" class=\"google-map\" style=\"height:" . $height . (!empty($width) ? ";width:" . $width . "" : "") . "\"></div>"; $mapscript .= '<script type="text/javascript">'; $mapscript .= 'jQuery(document).ready(function($) { try { var map,center = new google.maps.LatLng(' . $lat . ',' . $lang . '),' . (isset($mapStyle[$style]) ? "style=" . $mapStyle[$style] . "," : "") . ' mapOptions = {center: center,mapTypeControl: false,' . @implode(',', $mapOptions) . (isset($mapStyle[$style]) ? ",styles:style" : "") . '}; ' . $markerOption . ' map = new google.maps.Map(document.getElementById(\'map-canvas' . $dt_el_id . '\'),mapOptions); var marker = new google.maps.Marker({ position: center, map: map, ' . (!empty($markerOption) ? "icon: iconMarker" : "") . ' }); } catch ($err) { } }); </script>' . "\n"; $css_style = getCssMargin($atts); if ('' == $el_id && '' != $css_style) { $el_id = "map" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= '' != $el_class ? "class=\"" . $el_class . "\"" : ""; $compile .= ">"; if ("" != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= $mapscript; $compile .= "</div>"; return $compile; }
function render($atts, $content = null, $base = '') { wp_enqueue_style('detheme-builder'); global $DEstyle; extract(shortcode_atts(array('layout_type' => 'section-heading-border', 'separator_position' => '', 'use_decoration' => false, 'separator_color' => '', 'main_heading' => '', 'text_align' => 'center', 'color' => '', 'el_id' => '', 'el_class' => '', 'font_weight' => '', 'font_style' => '', 'font_size' => 'default', 'custom_font_size' => '', 'separator_color' => '', 'spy' => '', 'scroll_delay' => 300), $atts, 'section_header')); $css_class = array('dt-section-head', $text_align); $heading_style = array(); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-section-head-" . getCssID(); } if ('default' !== $font_size) { array_push($css_class, " size-" . $font_size); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('none' !== $spy && !empty($spy)) { $compile .= 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . (int) $scroll_delay . '}" '; } if (!empty($color)) { $heading_style['color'] = "color:" . $color; } if (!empty($font_weight) && $font_weight != 'default') { $heading_style['font-weight'] = "font-weight:" . $font_weight; } if (!empty($font_style) && $font_style != 'default') { $heading_style['font-style'] = "font-style:" . $font_style; } if (!empty($custom_font_size) && $font_size == 'custom') { $custom_font_size = preg_match('/(px|pt)$/', $custom_font_size) ? $custom_font_size : $custom_font_size . "px"; $heading_style['font-size'] = "font-size:" . $custom_font_size; } if ($use_decoration) { $decoration_position = $after_heading = ""; if ($layout_type == 'section-heading-polkadot-two-bottom') { $decoration_position = "polka-" . $separator_position; } elseif ($layout_type == 'section-heading-thick-border') { $decoration_position = "thick-" . $separator_position; } elseif ($layout_type == 'section-heading-thin-border') { $decoration_position = "thin-" . $separator_position; } elseif ($layout_type == 'section-heading-double-border-bottom') { $decoration_position = "double-border-bottom-" . $separator_position; } elseif ($layout_type == 'section-heading-thin-border-top-bottom') { $decoration_position = "top-bottom-" . $separator_position; } if (!empty($separator_color)) { $heading_style['border-color'] = "border-color:" . $separator_color; switch ($layout_type) { case 'section-heading-border-top-bottom': case 'section-heading-thin-border-top-bottom': case 'section-heading-thick-border': case 'section-heading-thin-border': case 'section-heading-double-border-bottom': case 'section-heading-swirl': $DEstyle[] = "#" . $el_id . " h2:after,#" . $el_id . " h2:before{background-color:" . $separator_color . ";}"; break; case 'section-heading-colorblock': $DEstyle[] = "#" . $el_id . " h2{background-color:" . $separator_color . ";}"; break; case 'section-heading-point-bottom': $DEstyle[] = "#" . $el_id . " h2:before{border-top-color:" . $separator_color . ";}"; break; default: break; } } if ($layout_type == 'section-heading-swirl' || $layout_type == 'section-heading-wave') { array_push($css_class, $layout_type); } if ('section-heading-polkadot-left-right' == $layout_type) { array_push($css_class, "hide-overflow"); } if ($layout_type == 'section-heading-swirl') { $after_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "104" : ($text_align == 'right' ? "24" : "64")) . ' 22"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#swirl"></use> </svg>'; } elseif ($layout_type == 'section-heading-wave') { $after_heading .= '<svg viewBox="0 0 ' . ($text_align == 'left' ? "126" : ($text_align == 'right' ? "2" : "64")) . ' 30"' . ($separator_color != '' ? " style=\"color:" . $separator_color . "\"" : "") . '> <use xlink:href="' . get_dt_plugin_dir_url() . 'images/source.svg#wave"></use> </svg>'; } $compile .= 'class="' . @implode(" ", $css_class) . '">'; $compile .= '<div class="dt-section-container"><h2 class="section-main-title ' . $layout_type . ' ' . $decoration_position . '"' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . '> ' . $main_heading . ' </h2>' . $after_heading . ' </div></div>'; } else { $compile .= 'class="' . @implode(" ", $css_class) . '"> <div>' . (!empty($main_heading) ? '<h2' . (count($heading_style) ? " style=\"" . @implode(";", $heading_style) . "\"" : "") . ' class="section-main-title">' . $main_heading . '</h2>' : '') . '</div></div>'; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = '') { extract(shortcode_atts(array('el_id' => '', 'el_class' => '', 'spy' => '', 'scroll_delay' => 300, 'perpage' => '-1', 'layout' => '', 'columns' => '', 'desktop_column' => '', 'mobile_column' => '', 'medium_column' => '', 'small_column' => '', 'gutter' => 0, 'cat' => '', 'orderby' => '', 'order' => ''), $atts, 'dt_post')); global $DEstyle; $css_class = array('dt_post'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_post" . getCssID(); } $query_args = array('posts_per_page' => $perpage, 'post_type' => 'post', 'no_found_rows' => false, 'post_status' => 'publish', 'ignore_sticky_posts' => true); if ($orderby != '') { $query_args['orderby'] = in_array(strtolower($orderby), array('date', 'title', 'id', 'modified', 'author', 'comment_count', 'rand')) ? strtolower($orderby) : 'date'; } if (strtolower($order) != '' && in_array(strtolower($order), array('asc', 'desc'))) { $query_args['order'] = strtoupper($order); } if ($cat != '') { $query_args['cat'] = $cat; } wp_enqueue_script('isotope.pkgd', untrailingslashit(get_dt_plugin_dir_url()) . '/js/isotope.pkgd.min.js', array(), '2.0.0', false); wp_enqueue_script('detheme-post-grid', untrailingslashit(get_dt_plugin_dir_url()) . '/js/post_grid.js', array(), '2.0.0', false); $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= "class=\"" . @implode(" ", $css_class) . "\" data-isotope=\"" . $layout . "\"" . " data-gutter=\"" . intval($gutter) . "\"" . " data-column=\"" . intval($columns) . "\"" . " data-column-lg=\"" . intval($desktop_column) . "\"" . " data-column-md=\"" . intval($medium_column) . "\"" . " data-column-sm=\"" . intval($small_column) . "\"" . " data-column-xs=\"" . intval($mobile_column) . "\"" . "><div class=\"grid-container\">"; $spydly = 0; $query = new WP_Query($query_args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $post = $query->post; $post->post_format = get_post_format(); $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $spydly = $spydly + (int) $scroll_delay; $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } ob_start(); ?> <div class="isotope-item"<?php print $scollspy; ?> > <div class="isotope-inner <?php print $post->post_format; ?> "> <?php get_template_part('content', get_post_format()); ?> </div> </div> <?php $compile .= ob_get_contents(); ob_end_clean(); } } wp_reset_postdata(); $compile .= "</div></div>"; if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } return $compile; }
function render($atts, $content = null, $base = '') { global $DEstyle; wp_enqueue_style('detheme-builder'); if (!isset($compile)) { $compile = ''; } extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'text' => '', 'layout_type' => 'fix', 'image_url' => '', 'facebook' => '', 'twitter' => '', 'gplus' => '', 'pinterest' => '', 'linkedin' => '', 'website' => '', 'email' => '', 'social_link' => 'show', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => '', 'color' => '', 'titlecolor' => '', 'separator_color' => '', 'subtitlecolor' => ''), $atts, 'dt_team_custom_item')); $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $social_lists = "<ul class=\"profile-scocial\">" . ($facebook ? "<li><a href=\"" . $facebook . "\" target=\"_blank\"><i class=\"fontelloicon-facebook-squared\"></i></a></li>" : "") . ($twitter ? "<li><a href=\"" . $twitter . "\" target=\"_blank\"><i class=\"fontelloicon-twitter-squared\"></i></a></li>" : "") . ($gplus ? "<li><a href=\"" . $gplus . "\" target=\"_blank\"><i class=\"fontelloicon-gplus-squared\"></i></a></li>" : "") . ($linkedin ? "<li><a href=\"" . $linkedin . "\" target=\"_blank\"><i class=\"fontelloicon-linkedin-5\"></i></a></li>" : "") . ($pinterest ? "<li><a href=\"" . $pinterest . "\" target=\"_blank\"><i class=\"fontelloicon-pinterest-squared\"></i></a></li>" : "") . ($website ? "<li><a href=\"" . $website . "\" target=\"_blank\"><i class=\"fontelloicon-globe\"></i></a></li>" : "") . ($email ? "<li><a href=mailto:" . $email . " target=\"_blank\"><i class=\"fontelloicon-mail-alt\"></i></a></li>" : "") . "</ul>"; if ('fix' == $layout_type) { if (!empty($image_url)) { $image = wp_get_attachment_image_src($image_url, 'full', false); $image_url = $image[0]; } $custom_team = '<div class="left-item"><img src="' . $image_url . '" alt="" /></div> <div class="right-item"><h2 class="profile-title">' . $title . '</h2><hr/><h3 class="profile-position">' . $sub_title . '</h3> ' . (!empty($text) ? '<div class="text">' . $text . '</div>' : "") . ('show' == $social_link ? $social_lists : "") . ' </div>'; } else { if (!empty($image_url)) { $image = wp_get_attachment_image_src($image_url, 'full', false); $image_url = $image[0]; } $custom_team = '<div class="profile"> <figure> <div class="top-image"> <img src="' . $image_url . '" class="img-responsive" alt=""/> </div> <figcaption> <h3><span class="profile-heading">' . $title . '</span></h3> <span class="profile-subheading">' . $sub_title . '</span> ' . (!empty($text) ? '<p>' . $text . '</p>' : ""); $custom_team .= $social_lists . '<div class="figcap"></div> </figcaption> </figure> </div>'; } $css_class = array('dt_team_custom_item', $layout_type, 'clearfix'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "dt-custom-team" . getCssID(); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ("" != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } if ("" != $titlecolor) { $DEstyle[] = "#{$el_id} .profile-title {color:" . $titlecolor . "}"; } if ("" != $separator_color) { $DEstyle[] = "#{$el_id} hr:after {background-color:" . $separator_color . "}"; } if ("" != $subtitlecolor) { $DEstyle[] = "#{$el_id} .profile-position {color:" . $subtitlecolor . " !important;}"; } if ("" != $color) { $DEstyle[] = "#{$el_id} .text,#{$el_id} .profile-scocial i {color:" . $color . "}"; } $compile .= 'class="' . @implode(" ", $css_class) . '" ' . $scollspy . '>'; $compile .= $custom_team; $compile .= '</div>'; return $compile; }
function render($atts, $content = null, $base = '') { global $DEstyle; extract(shortcode_atts(array('el_class' => '', 'el_id' => '', 'title' => '', 'spy' => 'none', 'taxonomy' => '', 'scroll_delay' => 300), $atts, 'tag_cloud')); $class = array('tag_cloud'); if ('' != $el_class) { array_push($class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id) { $el_id = "tag_cloud_" . getCssID(); } if ('' != $css_style) { $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $scollspy = ""; if ('none' !== $spy && !empty($spy)) { $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $scroll_delay . '}"'; } $compile = "<div id=\"" . $el_id . "\" class=\"" . @implode(" ", $class) . "\"" . $scollspy . ">"; ob_start(); the_widget('WP_Widget_Tag_Cloud', $atts, array()); $compile .= ob_get_clean(); $compile .= "</div>"; return $compile; }
function render($atts, $content = null, $base = '') { extract(shortcode_atts(array('spy' => 'none', 'scroll_delay' => 300, 'pagination' => 1, 'speed' => 800, 'column' => 1, 'desktop_column' => 1, 'small_column' => 1, 'tablet_column' => 1, 'mobile_column' => 1, 'pagination_type' => 'bullet', 'pagination_image' => null, 'pagination_icon' => null, 'pagination_color' => '', 'pagination_size' => '', 'autoplay' => 0, 'el_class' => '', 'el_id' => '', 'interval' => 1000), $atts, 'dt_carousel')); $pattern = get_shortcode_regex(); if (!preg_match_all('/' . $pattern . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } wp_enqueue_style('owl.carousel'); wp_enqueue_script('owl.carousel'); $widgetID = getCssID("dt_carousel"); $spydly = 0; $i = 0; $paginationthumb = array(); $css_style = getCssMargin($atts); if ('' == $el_id && '' != $css_style) { $el_id = "carousel" . getCssID() . time() . rand(11, 99); } $css_class = array('owl-carousel-container'); if ('' != $el_class) { array_push($css_class, $el_class); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } $compile .= " class=\"" . @implode(" ", $css_class) . "\">"; if ("" != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= '<div class="owl-carousel" id="' . $widgetID . '">'; if ($pagination_image) { $pagination_thumb = @explode(',', $pagination_image); } if ($pagination_icon) { $pagination_icons = @explode(',', $pagination_icon); } foreach ($matches as $key => $matche) { $scollspy = ""; if ('none' !== $spy && !empty($spy) && $i < $column) { $spydly = $spydly + (int) $scroll_delay; $scollspy = ' data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; } $compile .= '<div class="owl-slide"' . $scollspy . '>' . do_shortcode($matche[0]) . '</div>'; $i++; if ($pagination_type !== 'bullet' && $pagination_type !== 'navigation' && $pagination) { $thumb = ""; if ($pagination_type == 'image' && !empty($pagination_thumb[$key])) { if (!empty($pagination_thumb[$key])) { $image = wp_get_attachment_image_src($pagination_thumb[$key]); $thumb = "<img src=\"" . $image[0] . "\" alt=\"\">"; } } elseif ($pagination_type == 'icon' && !empty($pagination_icons[$key])) { $thumb = "<i class=\"" . $pagination_icons[$key] . "\" ></i>"; } else { $thumb = "<span class=\"default-owl-page\">" . ($key + 1) . "</span>"; } $paginationthumb[$key] = "<span class=\"owl-page\">" . $thumb . "</span>"; } } $compile .= '</div>'; if ($pagination && $pagination_type == 'bullet' && ($pagination_color != '' || $pagination_size != '')) { $compile .= "<style type=\"text/css\">#{$widgetID} .owl-page span{" . ($pagination_color != '' ? "background-color:{$pagination_color};border-color:{$pagination_color}" : "") . ($pagination_size != '' ? ";width:" . $pagination_size . "px;height:" . $pagination_size . "px;border-radius:50%" : "") . "}</style>"; } if ($pagination && $pagination_type == 'navigation') { $paginationthumb = apply_filters("dt_carousel_navigation_btn", array("<span class=\"btn-owl prev\">" . __('Prev', 'detheme_builder') . "</span>", "<span class=\"btn-owl next\">" . __('Next', 'detheme_builder') . "</span>")); } if (count($paginationthumb)) { $compile .= '<div class="owl-custom-pagination">' . @implode(' ', $paginationthumb) . '</div>'; } $compile .= '</div>'; $script = '<script type="text/javascript">' . "\n" . 'jQuery(document).ready(function($) { \'use strict\';' . "\n" . ' var ' . $widgetID . ' = jQuery("#' . $widgetID . '"); try{ ' . $widgetID . '.owlCarousel({ items : ' . $column . ', itemsDesktop : [1200,' . $desktop_column . '], itemsDesktopSmall : [1023,' . $small_column . '], // 3 items betweem 900px and 601px itemsTablet : [768,' . $tablet_column . '], //2 items between 600 and 0; itemsMobile : [600,' . $mobile_column . '], // itemsMobile disabled - inherit from itemsTablet option pagination : ' . ($pagination && $pagination_type == 'bullet' ? "true" : "false") . "," . ($autoplay ? 'autoPlay:' . ($speed + $interval) . ',' : '') . "\r\n slideSpeed : " . $speed . ",paginationSpeed : " . $speed . ",rewindSpeed : " . $speed . ","; if (count($paginationthumb) && $pagination_type !== 'bullet' && $pagination_type !== 'navigation') { $script .= 'afterInit:function(el){ var $base=el,perpage=this.options.items,btn,currentBtn=1; btn=Math.ceil(this.itemsAmount/perpage); currentBtn=$(this.$owlItems[this.currentItem]).data("owl-roundPages"); $(\'.owl-custom-pagination .owl-page\',$base.parent()).each(function(i,el){ if(i >= btn ){$(el).hide();} else{ $(el).show();} if(i === currentBtn - 1 ){ $(this).closest(\'.owl-custom-pagination\').find(\'.owl-page\').removeClass(\'active\'); $(this).addClass(\'active\'); } $(el).click(function(){ $(\'.owl-custom-pagination .owl-page\',$base.parent()).removeClass(\'active\'); $(this).addClass(\'active\'); $base.trigger(\'owl.goTo\',(i*perpage)); }); }); }, afterUpdate:function(el){ var $base=el,perpage=this.options.items,btn,currentBtn=1; btn=Math.ceil(this.itemsAmount/perpage); currentBtn=$(this.$owlItems[this.currentItem]).data("owl-roundPages"); $(\'.owl-custom-pagination .owl-page\',$base.parent()).each(function(i,el){ if(i >= btn ){$(el).hide();} else{ $(el).show();} if(i === currentBtn - 1 ){ $(this).closest(\'.owl-custom-pagination\').find(\'.owl-page\').removeClass(\'active\'); $(this).addClass(\'active\'); } $(el).click(function(){ $(\'.owl-custom-pagination .owl-page\',$base.parent()).removeClass(\'active\'); $(this).addClass(\'active\'); $base.trigger(\'owl.goTo\',(i*perpage)); }); }); }'; } else { if (count($paginationthumb) && $pagination_type == 'navigation') { $script .= 'afterInit:function(el){ var $base=el; $(\'.owl-custom-pagination .next\',$base.parent()).click(function(){ $base.trigger(\'owl.next\'); }); $(\'.owl-custom-pagination .prev\',$base.parent()).click(function(){ $base.trigger(\'owl.prev\'); }); }'; } } $script .= '});'; $script .= '} catch(err){} });</script>'; return $compile . $script; }
function render($atts, $content = null, $base = '') { if (!has_shortcode($content, 'dt_verticaltab_item')) { return ""; } $regexshortcodes = '\\[' . '(\\[?)' . "(dt_verticaltab_item)" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] if (!preg_match_all('/' . $regexshortcodes . '/s', $content, $matches, PREG_SET_ORDER)) { return ""; } wp_enqueue_script('bootstrap', get_dt_plugin_dir_url() . 'js/bootstrap.js', array('jquery'), '3.0', false); wp_register_script('bootstrap-tabcollapse', get_dt_plugin_dir_url() . 'js/bootstrap-tabcollapse.js', array(), '1.0', false); wp_enqueue_script('bootstrap-tabcollapse'); wp_enqueue_style('bootstrap-tabs', get_dt_plugin_dir_url() . "css/bootstrap_vertical_tab.css", array()); extract(shortcode_atts(array('nav_position' => 'left', 'spy' => 'none', 'scroll_delay' => 300, 'el_id' => '', 'el_class' => ''), $atts, 'dt_verticaltab')); $leftspy = ""; $rightspy = ""; $spydly = $scroll_delay; if ('none' !== $spy && !empty($spy)) { switch ($spy) { case 'uk-animation-slide-left': $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\',delay:' . ($spydly + 600) . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'uk-animation-slide-right\',delay:' . $spydly . '}"'; break; case 'uk-animation-slide-right': $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . ($spydly + 600) . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'uk-animation-slide-left\',delay:' . $spydly . '}"'; break; default: $leftspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\',delay:' . $spydly . '}"'; $rightspy = 'data-uk-scrollspy="{cls:\'' . $spy . '\', delay:' . $spydly . '}"'; break; } } $cn_list = array(); $cn_preview = array(); $dt_vsliderid = getCssID(); $itemnumber = 0; foreach ($matches as $slideitem) { $slideitem[3] .= $itemnumber == 0 ? " active=\"1\"" : ""; $slideitem[3] .= " id=\"vstabid_" . $dt_vsliderid . '_' . $itemnumber . "\""; $cn_item = do_shortcode("[dt_verticaltab_item " . $slideitem[3] . "]" . $slideitem[5] . "[/dt_verticaltab_item]"); $cn_preview_item = '<div id="vstabid_' . $dt_vsliderid . '_' . $itemnumber . '" class="tab-pane fade' . ($itemnumber == 0 ? " in active" : "") . '">' . do_shortcode($slideitem[5]) . '</div>'; array_push($cn_list, $cn_item); array_push($cn_preview, $cn_preview_item); $itemnumber++; } $css_class = array('dt_vertical_tab'); if ('' != $el_class) { array_push($css_class, $el_class); } $css_style = getCssMargin($atts); if ('' == $el_id && "" != $css_style) { $el_id = "dt_tab_wrapper" . getCssID() . time() . rand(11, 99); } $compile = "<div "; if ('' != $el_id) { $compile .= "id=\"{$el_id}\" "; } if ('' != $css_style) { global $DEstyle; $DEstyle[] = "#{$el_id} {" . $css_style . "}"; } $compile .= "class=\"" . @implode(" ", $css_class) . "\">"; $compile .= '<ul id="vstabid_' . $dt_vsliderid . '" class="nav nav-tabs vertical-nav-tab tab-' . $nav_position . '" ' . $leftspy . '>' . @implode("\n", $cn_list) . ' </ul>' . "\n" . '<div class="tab-content vertical-tab-content tab-' . $nav_position . '" ' . $rightspy . '> ' . @implode("\n", $cn_preview) . '</div>' . "\n"; $compile .= '</div>'; $compile .= '<script type="text/javascript"> jQuery(document).ready(function($){ $(\'#vstabid_' . $dt_vsliderid . '\').tabCollapse(); }); </script>'; return $compile; }