Image Slider flashes wrong image at first

I am using a wordpress theme, Pitch Pro, and it has a built in slider. My issue is that sometimes the slider will flash the wrong image for a second. I noticed that it does not do it normally but only if I go from a page such as support to the home page. I have tried changed and setting the order. Changing the max amount of slides, currently 6, but nothing seems to fix it.

The site currently is jrummy16.com/test if anyone has any idea on a fix.

Read More

Not sure if this could relate to it anyway but the server I am using has issues and to fix it hostgator told me to add define( ‘CONCATENATE_SCRIPTS’, false ); to my config.php file. It fixed the issue but I do not recall the slider having this issue before adding that.

I have no idea on how to even start troubleshooting this. So any help would be greatly appreciated.

EDIT
All of the files were found inside the Theme, Pitch Pro.

I opened up my home.php file and I find this at the top for slider.

<?php
    $slider_template = apply_filters('pitch_slider_template', array('slider', null));   
    get_template_part( $slider_template[0], $slider_template[1] );
?>

I then went and opened up slider.php in the same folder. It has this code,

<?php

$slides = new WP_Query(array(
    'numberposts' => siteorigin_setting('slider_max_slides'),
    'nopaging'     => true,
    'post_type' => 'slide',
    'orderby' => 'menu_order',
    'order' => 'ASC'
));

if($slides->have_posts()){
    ?>
    <div id="slider">
        <div class="container">
            <div class="slides nivoSlider">
                <?php while ($slides->have_posts()) : $slides->the_post(); if(has_post_thumbnail()) :  ?>

                    <?php if(get_post_meta(get_the_ID(), 'slide_destination', true)) : $destination = get_post_meta(get_the_ID(), 'slide_destination', true) ?>
                        <?php echo '<a href="'.esc_url(get_permalink($destination)).'" title="'.esc_attr(get_the_title($destination)).'">' ?>
                    <?php elseif(get_post_meta(get_the_ID(), 'slide_destination_url', true)) : $destination = get_post_meta(get_the_ID(), 'slide_destination_url', true) ?>
                        <?php echo '<a href="'.esc_url($destination).'">' ?>
                    <?php endif; ?>
                    <?php echo get_the_post_thumbnail(get_the_ID(), 'slide') ?>
                    <?php if(!empty($destination)) echo '</a>' ?>
                <?php endif; endwhile; ?>
            </div>

            <?php $slides->rewind_posts(); ?>

            <div class="indicators-wrapper">
                <ul class="indicators">
                    <?php while ($slides->have_posts()) : $slides->the_post(); if(has_post_thumbnail()) :  ?>
                    <li class="indicator <?php if($slides->current_post == 0) echo 'active' ?> indicator-group-<?php echo $slides->post_count ?>">
                        <div class="indicator-container">
                            <div class="pointer"></div>
                            <h4><?php the_title() ?></h4>
                            <?php the_excerpt() ?>
                        </div>
                    </li>
                    <?php endif; endwhile; ?>
                </ul>
            </div>
        </div>
    </div>
    <?php
    wp_reset_postdata();
}

I am not sure if this will help or not but I hope that it does.

Related posts

Leave a Reply

1 comment

  1. I think the reason is that before slider loads completely, the page will show last image in the list of slides and in your case it is this one:

    <img width="705" height="344" src="http://jrummy16.com/test/wp-content/uploads/BA-slider.jpg" class="attachment-slide wp-post-image" alt="BA-slider">
    

    Here is a similar problem and it has few of the solutions which you may use it as well.

    UPDATE:

    I found this article which suggests to modify your CSS. I would paste the code here but the article uses image to show CSS code:)