• I have a theme that uses Bootstrap 3. The design calls for a full width slider underneath the header and navigation bar. I’m using meta slider and trying to make things really simple for the content authors by using page builder.

    I need to be able to break the slider out of a normal bootstrap container and have it use a fluid container. The only way I can think to do this is to have a separate template for each page so that the correct slider is loaded but that would be messy.

    Is there a better way. I’d prefer not to hard code anything into templates if possible.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You’d only need 1 different template, which is fine because you want a different HTML structure. Alternatively you can just add a PHP conditional statement in to check something and then do your slider stuff, e.g.:

    if (something) {
    
    ?>
        </div><!-- .container -->
    </div><!-- .wrapper -->
    
    <div class="wrapper">
        <div class="container">
            <div class="slider"> [...] </div>
        </div><!-- .container -->
    </div><!-- .wrapper -->
    
    <div class="wrapper">
        <div class="container">
    <?php
    }

    Thread Starter handcoded

    (@handcoded)

    That was kind of my thinking.

    What I have opted for is to add some PHP to a custom template that checks for the page slug and if a match is found echo’s the shortcode for the slider.

    if (is_front_page()); {
    	echo do_shortcode("[metaslider id=44]");
    }
    
    if (is_page( 'governors' )); {
    	echo do_shortcode("[metaslider id=161]");
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Break page content apart’ is closed to new replies.