Support » Plugin: Smart Slider 2 » Full Width Slider (Not Background/Fixed)

  • Resolved CarolLeung

    (@carolleung)


    I tried using the code that was offered before and it works great making my slider full width, but I didn’t like the fact that it was fixed in a specific position since it was for full-width “background” slider that was requested before.

    When I changed the position to absolute or relative, it changes back to the normal width again. What code should I use to make my slider full width but still scroll with the page that is below my menu and header?

    https://wordpress.org/plugins/smart-slider-2/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter CarolLeung

    (@carolleung)

    I don’t mind using PHP or just html/css shortcode on my page whichever one works better…

    Thread Starter CarolLeung

    (@carolleung)

    Plugin Author Gabor

    (@nextendweb_gabor)

    Hi! If you want to make your slider to have the width of the screen, you will have to put the slider’s shortcode into your theme. You can read about this in here:
    http://www.nextendweb.com/wiki/smart-slider-documentation/frequently-asked-questions/#fullwidthwp

    The code you should look for is this (it will be probably in your theme’s header.php file):
    </header>
    and put your slider’s code right under it:

    <?php
    	if(is_home() || is_front_page()){
    		echo do_shortcode('[smartslider2 slider="5"]');
    	}
    ?>

    or just this, if you want it on all of your pages:
    <?php echo do_shortcode('[smartslider2 slider="5"]'); ?>

    Thread Starter CarolLeung

    (@carolleung)

    Actually, I already read the FAQ and tried that PHP code in my header, but its not full width and it appears on top of my banner and navigation bar.

    <br />
    <?php<br />
    	if(is_home() || is_front_page()){<br />
    		echo do_shortcode('[smartslider2 slider="5"]');<br />
    	}<br />
    ?><br />

    For some weirder reason, it enlarges my banner and menu by a whole lot and dearranges my current layout.

    Maybe because I am putting the code in the wrong place in the header.php? I already placed it under site navigation code though.

    Thread Starter CarolLeung

    (@carolleung)

    Nevermind, I placed it below the </header> and it works now. Thanks!

    I just placed it in the wrong place. I added a

    <div style="margin-top: -22px">

    above since there is extra margin above the slider.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Full Width Slider (Not Background/Fixed)’ is closed to new replies.