Support

Account

Home Forums Add-ons Gallery Field Slider captions with links

Helping

Slider captions with links

  • Hi

    I am going crazy over this. I am fairly new to WordPress and am trying to add it as a CMS to a site I built. Everything is working except for one thing and I can’t seem to get it to work.

    I have got a Cycle2 slideshow on my homepage and have used an ACF Gallery to add my images. I have also got a slide counter and a caption with each image. What I want to do is have my captions link to individual posts and I cannot figure out how to do this.

    I would be more than grateful for any hint!! as I am loosing my mind over this…

    Thank you!!

    This is my code:

    <?php get_header() ?>
    
    <main>
    		
    	<?php 
    
    $images = get_field('image_gallery');
    
    if( $images ): ?>
    <div class="slideshowwrapper">
    	<div class="cycle-slideshow" 
    		    data-cycle-fx=scrollHorz
    		    data-cycle-timeout=0
    		    data-cycle-caption="#title-caption"
    		    data-cycle-caption-template=" {{title}} {{alt}} {{slideNum}} / {{slideCount}} ">
    			
    		<div class="cycle-prev"></div>
    		<div class="cycle-next"></div>
    
            	<?php foreach( $images as $image ): ?>
                 	<img src="<?php echo $image['sizes']['large']; ?>" title="<?php echo $image['title']; ?>"/>
              
            	<?php endforeach; ?>
       
        </div>				
     </div>
    <?php endif; ?>
    
    <!-- empty element for caption -->
    <div id="title-caption" class="imagenumber"></div>
    
    						
    </main>
    	<!-- end of container div -->
    	<?php get_footer() ?>
  • it’s resolved – i finally got it to work!!!

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Slider captions with links’ is closed to new replies.