Slider does not go to the next slide

I’m new in the php and I’m trying to customize my wordpress theme. The problem is that slider goes to the next slide only when I press the dot under the slider manually but I want to move automatically every 3 seconds. Here is the slider code:

[php]<?php
if (ci_setting(‘slider_show’) == ‘enabled’): ?>

    <?php $slider_no = ci_setting('slider-no');
			global $post;
			$slider = new WP_Query( array( 
				'post_type' => 'cpt_slider', 
				'posts_per_page' => $slider_no
			)); 
			
			while ( $slider->have_posts() ) : $slider->the_post();
			$img_id = false;
			$img_url = '';
			$img_id = get_post_thumbnail_id($post->ID);
			$img_info = wp_get_attachment_image_src($img_id, 'ci_home_slider');
			$img_url = $img_info[0];
			
			$slider_text = get_post_meta($post->ID, 'ci_cpt_slider_text', true);
			$slider_video = get_post_meta($post->ID, 'ci_cpt_slider_video', true);
			
			if(!empty($img_url)): ?>
			<li>
				<?php $slider_link = get_post_meta($post->ID, 'ci_cpt_slider_url', true); ?>
				<?php if ($slider_link != ""): ?><a href="<?php echo $slider_link; ?>" class="slide-more"><?php endif; ?>
				  <img src="<?php echo $img_url; ?>" alt="<?php the_title(); ?>" />					  
				  <?php if ($slider_text != 1): ?>	
				  					  
				  	<div class="slider-text-wrap group">
						<div class="slide-text">
							<span class="slide-title"><?php the_title(); ?></span>
							<?php if ($slider_link != ""): ?><a href="<?php echo $slider_link; ?>">Read more</a><?php endif; ?>
						</div>
					</div>
				  
				  <?php endif; ?>
				<?php if ($slider_link != ""): ?></a><?php endif; ?>
		    </li>
		<?php else: ?>
			<li class="video-slide">
				<?php echo wp_oembed_get($slider_video); ?>
			</li>						
		<?php endif; endwhile; ?>
		<?php wp_reset_postdata(); ?>		    
		</ul>
	</div>
</div>
<?php endif; ?>[/php]

I appreciate your help.

This won’t be a php problem, php doesn’t have any effect on the manipulation of a slider after the page loads. The slider functioning would be done through a javascript, so you should look there for the issue. Likely it’s a setting you can declare.

Sponsor our Newsletter | Privacy Policy | Terms of Service