Slider loading with white bank screen. It may be problem with active class of the slider but I can find it for fixing. Here is the code ---

<section id="main-slider" class="no-margin">
    <div class="carousel slide">
        <ol class="carousel-indicators">
            <li data-target="#main-slider" data-slide-to="0" class="active"></li>
            <li data-target="#main-slider" data-slide-to="1"></li>
            <li data-target="#main-slider" data-slide-to="2"></li>
        <div class="carousel-inner">   
global $post;
$args = array(  'post_type' => 'slide',
                'posts_per_page' => 5 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) :  setup_postdata($post); 
    $slide_bg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'slide-bg');?>            
            <div class="item" style="background-image: url(<?php echo  $slide_bg[0];?>)">
                <div class="container">
                    <div class="row slide-margin">
                        <div class="col-sm-6">
                            <div class="carousel-content">
                                <h1 class="animation animated-item-1"><?php the_title(); ?></h1>
                                <h2 class="animation animated-item-2"><?php the_content();?></h2>
                                <a class="btn-slide animation animated-item-3" href="#">Read More</a>

            <?php endforeach; wp_reset_postdata(); ?>
    <a class="prev hidden-xs" href="#main-slider" data-slide="prev">
        <i class="fa fa-chevron-left"></i>
    <a class="next hidden-xs" href="#main-slider" data-slide="next">
        <i class="fa fa-chevron-right"></i>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.