function yit_revslider_slider() { $operations = new RevOperations(); $arrValues = $operations->getGeneralSettingsValues(); $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on"); $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true ); $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider"); if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) { return; } wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION); $custom_css = RevOperations::getStaticCss(); $custom_css = UniteCssParserRev::compress_css($custom_css); wp_add_inline_style('rs-plugin-settings', $custom_css); $setBase = (is_ssl()) ? "https://" : "http://"; $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution"; wp_enqueue_script("jquery", $url_jquery); // put javascript to footer add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript')); }
/** * Remove Add to wishlist text option * */ function yit_add_slider_class_body() { $slider_name = yit_slider_name(); if ($slider_name == 'none' || empty($slider_name)) { return; } $slider_type = yit_slider_get_setting('slider_type', $slider_name); $slider_width = yit_slider_get_setting('width_' . $slider_type, $slider_name); if (in_array($slider_type, array('revolution', 'revolution-slider', 'elastic', 'thumbnails')) && $slider_width == 0) { $is_full_width = true; } else { $is_full_width = false; } // revolution slider if ($slider_type == 'revolution-slider' && class_exists('RevSlider')) { $revolution = yit_slider_get_setting('slider_name_' . $slider_type, $slider_name); $the_slider = new RevSlider(); $the_slider->initByMixed($revolution); if (in_array($the_slider->getParam('slider_type'), array('fixed', 'responsitive'))) { $is_full_width = false; } } yit_add_body_class('header-slider-' . $slider_type); yit_add_body_class('slider-' . ($is_full_width ? 'full-width' : 'fixed')); }
/** * The shortcode used to show theslider * * @since 1.0.0 */ public function slider_shortcode($atts, $content = null) { $atts = shortcode_atts(array('name' => null, 'align' => ''), $atts); // make sure that if the 'name' attributes is empty or null, is get the slider name defined for the page template if (empty($atts['name'])) { $atts['name'] = yit_slider_name(); } // don't show the slider if 'name' is empty or is 'none' if (empty($atts['name']) || 'none' == $atts['name']) { return; } // save the shortcode attributes in the global array, to get them with the ->get() method $this->shortcode_atts = $atts; // set the loop for the slider $this->set_slider_loop($atts['name']); // enqueue in the footer the scripts of this portfolio $assets = isset($this->_sliderAssets[$this->get('slider_type')]['js']) ? $this->_sliderAssets[$this->get('slider_type')]['js'] : array(); foreach ($assets as $handle => $asset_src) { wp_enqueue_script($handle); } ob_start(); $this->_getSliderFile('slider.php', $this->get('slider_type')); // increase the index of sliders shown $this->slider_index++; // add the responsive replace $responsive_mode = $this->get('responsive_mode'); if (yit_get_option('responsive-enabled') && !$this->responsive_sliders[$this->get('slider_type')] && !empty($responsive_mode) && $responsive_mode != 'none') { ?> <div class="mobile-slider <?php echo $this->get('slider_type'); ?> "><?php if ($responsive_mode != 'fixed-image') { echo $this->slider_shortcode(array('name' => $responsive_mode)); } else { ?> <div class="slider fixed-image container"><img src="<?php $this->the('responsive_image'); ?> " alt="" /></div><?php } ?> </div><?php $this->slider_index++; } return ob_get_clean(); }