Support » Theme: Sydney » Lazy load of header slider images

  • Hello,
    I am running the Sydney theme. I have a slider with text running on my website’s header. The images for the slider are optimized. I was wondering if there is a way to push the slider images to load last (except the first slide) so the user can get a good initial impression.
    Thanks a lot.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Currently the theme doesn’t come with a setting for that.

    However, you may want to try this plugin to achieve the same result.

    https://id.wordpress.org/plugins/lazy-loading-responsive-images/

    Regards,
    Kharis

    Thread Starter giorgos236

    (@giorgos236)

    Hi Kharis,
    Thank you for the answer. If I wanted to offload the images of the slider to another server where exactly does the theme load the slider images from? (not in the customizer, I am asking for the script). Also, would it be possible to add more than 5 images and if so how?
    Thank you.

    Hi,

    Thank you for getting back.

    If I wanted to offload the images of the slider to another server where exactly does the theme load the slider images from?

    The slider images are located in inc/slider.php file within this code block:

    <?php $c = 1; ?>
    <?php foreach ( $images as $image ) {
    	if ( $image ) {
    
            $image_alt = sydney_image_alt( $image );
    		?>
            <div class="slide-item slide-item-<?php echo $c; ?>" style="background-image:url('<?php echo esc_url( $image ); ?>');">
                <img class="mobile-slide preserve" src="<?php echo esc_url( $image ); ?>" alt="<?php echo esc_attr( $image_alt ); ?>"/>
                <div class="slide-inner">
                    <div class="contain animated fadeInRightBig text-slider">
                    <h2 class="maintitle"><?php echo wp_kses_post( $titles['slider_title_' . $c] ); ?></h2>
                    <p class="subtitle"><?php echo esc_html( $subtitles['slider_subtitle_' . $c] ); ?></p>
                    </div>
                    <?php echo $button; ?>
                </div>
            </div>
            <?php
    	}
    	$c++;
    }
    ?>
    

    Also, would it be possible to add more than 5 images and if so how?

    Yes, it is possible. You can try this custom jQuery code solution:

    https://forums.athemes.com/t/three-cta-buttons-in-welcome-area/15969/2

    I hope that helps.

    Regards,
    Kharis

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