Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #568806

    Hi,
    hope this question isn’t asked too often ;-)
    And I also hope the answer is simple (I’m not so experienced in PHP)!

    Thanks!

    #568823

    Hey!

    Please go to Enfold/includes folder and edit loop-search.php file. You can add it using shortcode. Please see – https://developer.wordpress.org/reference/functions/do_shortcode/

    Regards,
    Yigit

    #569885

    Hi Yigit,
    sorry but I don’t get what I’ve to put in loop-search.php code…

    Thank you

    #570169

    Hi!

    When you create a slider you will get a shortcode which you need to add it in the loop-search.php page as explained in the above link

    Best regards,
    Vinay

    #570200

    I’m afraid this goes beyond me… = (
    I did a try on loop-search.php file but:

    1. I don’t get where to put it (which line, if I want the slider to be shown as the page header)
    2. Maybe I did not write it correctly, because I see nothing different
    #570208

    Hey!

    Where exactly would you like to add the slider? We can provide you more detailed instructions.

    Regards,
    Yigit

    #570222

    Look at the page in pvt content. I’d like to have the same slider in my search page.

    Thank you!

    #572646

    Hi!

    Unfortunately, adding the layer slider as shortcode is not going to work. You can append it on top of the search page but the slider will not initialized correctly. Example (functions.php file):

    // add layer slider in search
    add_action('ava_after_main_title', 'add_layer_slider');
    function add_layer_slider() {
    	if( is_search() ) {
    		 echo do_shortcode("[av_layerslider id='1']");
    	}
    }

    Please try to use this instead:

    // add layer slider in search
    add_action('ava_after_main_title', 'add_layer_slider');
    function add_layer_slider() {
    	if( is_search() ) {
    
    		$resources = "<link rel='stylesheet' id='layerslider-css'  href='http://localhost/kriesi/enfold/wp-content/themes/enfold/config-layerslider/LayerSlider/static/css/layerslider.css?ver=5.6.2' type='text/css' media='all' />
    		<script type='text/javascript' src='http://localhost/kriesi/enfold/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/greensock.js?ver=1.11.8'></script>
    		<script type='text/javascript' src='http://localhost/kriesi/enfold/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/layerslider.kreaturamedia.jquery.js?ver=5.6.2'></script>
    		<script type='text/javascript' src='http://localhost/kriesi/enfold/wp-content/themes/enfold/config-layerslider/LayerSlider/static/js/layerslider.transitions.js?ver=5.6.2'></script>";
    
    		$script = "<script data-cfasync=\"false\" type=\"text/javascript\">var lsjQuery = jQuery;</script><script data-cfasync=\"false\" type=\"text/javascript\"> lsjQuery(document).ready(function() { if(typeof lsjQuery.fn.layerSlider == \"undefined\") { lsShowNotice('layerslider_7_1','jquery'); } else { lsjQuery(\"#layerslider_7_1\").layerSlider({responsiveUnder: 1140, layersContainer: 1140, autoStart: false, startInViewport: false, pauseOnHover: false, twoWaySlideshow: true, loops: 1, keybNav: false, touchNav: false, skin: 'fullwidth', globalBGColor: 'rgba(255, 255, 255, 0.45)', navPrevNext: false, hoverPrevNext: false, navStartStop: false, navButtons: false, showCircleTimer: false, thumbnailNavigation: 'disabled', lazyLoad: false, yourLogoStyle: 'left: 10px; top: 10px;', cbInit: function(element) { }, cbStart: function(data) { }, cbStop: function(data) { }, cbPause: function(data) { }, cbAnimStart: function(data) { }, cbAnimStop: function(data) { }, cbPrev: function(data) { }, cbNext: function(data) { }, skinsPath: 'http://www.saldaturacontrollo.it/wp/wp-content/themes/enfold/config-layerslider/LayerSlider/static/skins/'}) } }); </script>";
    
    		 $output = $resources . '<div id="layer_slider_1" class="avia-layerslider main_color avia-shadow  avia-builder-el-0  el_before_av_one_full  avia-builder-el-first  container_wrap sidebar_right" style="height: auto;"><div class="ls-wp-fullwidth-container" style="height: 121px;">'.$script.'<div class="ls-wp-fullwidth-helper" style="width: 918px; height: 121px; left: 0px;"><div id="layerslider_7_1" class="ls-wp-container ls-container ls-fullwidth" style="width: 918px; height: 120.789px; margin: 0px auto; visibility: visible;"><div class="ls-inner" style="width: 918px; height: 121px; background-color: rgba(255, 255, 255, 0.45098);"><div class="ls-slide ls-animating" data-ls=" transition2d: all;" style="width: 918px; height: 121px; visibility: visible; display: none; left: auto; right: 0px; top: 0px; bottom: auto;"><img src="http://www.saldaturacontrollo.it/wp/wp-content/uploads/2016/01/news3.jpg" class="ls-bg ls-preloaded" alt="news3" style="padding: 0px; border-width: 0px; width: 1610.53px; height: 120.789px; margin-left: -346.263px; margin-top: 0.105263px;"><div class="ls-gpuhack" style="width: auto; height: auto; padding: 0px; border-width: 0px; left: 0px; top: 0px;"></div><p class="ls-l" style="top: 56.3684px; left: -22.5474px; white-space: nowrap; width: auto; height: auto; font-size: 10.4684px; line-height: 11.2737px; padding: 0px; border-width: 0px; margin-left: 0px; margin-top: 0px; transform-origin: 50% 50% 0px; transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1); opacity: 1; visibility: visible;"><span class="slide-slogan2">I corsi in partenza e le nostre novità</span></p></div></div><div class="ls-loading-container" style="z-index: -1; display: none;"><div class="ls-loading-indicator"></div></div><div class="ls-shadow"></div></div></div></div></div>';
    
    		echo $output;
    	}
    }
    

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.