/** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget($args, $instance) { if ($this->get_cached_widget($args)) { return; } ob_start(); extract($args); $slider = absint($instance['slider']); echo $before_widget; if (function_exists('soliloquy_slider')) { add_filter('tgmsp_caption_output', array($this, 'caption_output'), 10, 3); add_filter('tgmsp_slider_width_output', array($this, 'width_height')); add_filter('tgmsp_slider_height_output', array($this, 'width_height')); add_filter('tgmsp_image_output', array($this, 'image_output'), 10, 5); soliloquy_slider($slider); remove_filter('tgmsp_caption_output', array($this, 'caption_output'), 10, 3); remove_filter('tgmsp_slider_width_output', array($this, 'width_height')); remove_filter('tgmsp_slider_height_output', array($this, 'width_height')); remove_filter('tgmsp_image_output', array($this, 'image_output'), 10, 5); } echo $after_widget; $content = ob_get_clean(); echo $content; $this->cache_widget($args, $content); }
function lsx_homepage_slider() { $slider = get_theme_mod('lsx_homepage_slider', 0); $show_on_front = get_option('show_on_front'); if ('0' != $slider && ('posts' == $show_on_front && is_home() || 'page' == $show_on_front && is_front_page())) { ?> <section class="soliloquy-slider lsx-homepage-slider slider-<?php echo $slider; ?> "> <?php soliloquy_slider($slider); ?> <?php classybeds_enquire_bar(); ?> </section> <?php } }