Auto slideshow for my post slider in php

Question

Hi I have this php code for creating a slider with my posts, I want it to auto slideshow for atleast 2 secs intervals or so. below is the code I manage to have but it is not automatically moving to next slide.

<?php
        $slider_query = array(
        'post_type' => 'slider',
        'posts_per_page' => -1);

        $slider_posts = new WP_Query( $slider_query );
        if ($slider_posts->have_posts()):
        while ( $slider_posts->have_posts() ) : $slider_posts->the_post();
?>

//my html code for slider images and text here //

<?php
        endwhile;
        endif;
         wp_reset_postdata();
?>

Hope someone can help me.

0
GorpBoon 5 months 2021-05-19T00:43:49-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse